package com.muli.muwai.api;

import com.muli.muwai.entity.*;
import org.apache.commons.lang3.StringUtils;

import java.sql.Timestamp;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.*;

public class Fenxiaofenke {
    //授权常量
    private static String appID = "FSAID_1319a08";

    private static String appSecret = "1af4ddc99f104020963bc07ac521e4e9";

    private static String permanentCode = "A157353D79BB911D9AE9A1A2668FBC00";

    private static String urlTest = "https://open.fxiaoke.com/cgi/corpAccessToken/get/V2";

    private static String urlTest2 = "https://open.fxiaoke.com/cgi/crm/v2/data/query";

    private static String urlTest3 = "https://open.fxiaoke.com/cgi/crm/custom/v2/data/query";

    private static String openUserId = "FSUID_42315E8605D5B50901B4366EAF2E5918";

    static HttpClientUtil httpClientUtil = new HttpClientUtil();


    //TODO "线索对象接口(客户跟踪表)TraceTable"
    public List<TraceTable> customerTracking(Integer offset, Integer limit) {
        Map map = fenXiangInterface();//17921-16000

        // String phone="13926825536";
        String param = "{\n" +
                "    \"corpAccessToken\": \"" + map.get("corpAccessToken") + "\",\n" +
                "    \"corpId\": \"" + map.get("corpId") + "\",\n" +
                "    \"currentOpenUserId\": \"" + openUserId + "\",\n" +
                "    \"data\": {\n" +
                "    \"search_query_info\": {\n" +
                "      \"offset\": " + offset + ",\n" +
                "      \"limit\": " + limit + ",\n" +
                "      \"filters\": [\n" +
                "           {\n" +
                "                    \"field_name\": \"create_time\",\n" +
                "                    \"field_values\": [\n" +
                "                        \"1598889600000\"\n" +
                "                    ],\n" +
                "                    \"operator\": \"GT\"\n" +
                "                }\n" +
                "      ]\n" +
                "    },\n" +
                "    \"dataObjectApiName\": \"LeadsObj\"\n" +
                "  }\n" +
                "  }";

        /*String param = "{\n" +
                "    \"corpAccessToken\": \""+map.get("corpAccessToken")+"\",\n" +
                "    \"corpId\": \""+map.get("corpId")+"\",\n" +
                "    \"currentOpenUserId\": \""+openUserId+"\",\n" +
                "    \"data\": {\n" +
                "    \"search_query_info\": {\n" +
                "      \"offset\": "+offset+",\n" +
                "      \"limit\": "+limit+",\n" +
                "      \"filters\": []\n" +
                "    },\n" +
                "    \"dataObjectApiName\": \"LeadsObj\"\n" +
                "  }\n" +
                "  }";*/

        Map map1 = httpClientUtil.sendPostForJson("", param, urlTest2);

        //获取最终数据
        Map<String, Object> data = (Map<String, Object>) map1.get("data");
        ArrayList<Object> dataList = (ArrayList<Object>) data.get("dataList");
        //定义实体类集合
        List<TraceTable> targetList = new ArrayList();


        //定义时间变量
        Date date = new Date();
        DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String time = df.format(date);



        //遍历最终数据
        for (int i = 0; i < dataList.size(); i++) {
            TraceTable traceTable = new TraceTable();
            Map<String, Object> mapdata = (Map<String, Object>) dataList.get(i);
            //获取值赋值到实体类
            traceTable.setUName((String) mapdata.get("name"));
            traceTable.setUPhone((String) mapdata.get("tel"));
            traceTable.setPRegion((String) mapdata.get("phone_number_attribution"));
            traceTable.setCompany((String) mapdata.get("company"));
            traceTable.setOutPerson((String) mapdata.get("out_owner"));
            traceTable.setCluesPool((String) mapdata.get("leads_pool_id"));
            traceTable.setHCategory((String) mapdata.get("UDSSel1__c"));
            traceTable.setC1Source((String) mapdata.get("UDSSel3__c"));
            traceTable.setUNote((String) mapdata.get("UDMText1__c"));
            traceTable.setAddress((String) mapdata.get("UDSText1__c"));
            traceTable.setC2Source((String) mapdata.get("UDSSel2__c"));
            traceTable.setCDepartment((String) mapdata.get("UDSSel4__c"));
            traceTable.setC3Source((String) mapdata.get("UDCSSel1__c"));
            traceTable.setC4Source((String) mapdata.get("L1_UDCSSel1__c"));
            traceTable.setCity((String) mapdata.get("field_Bh1Vi__c"));
            traceTable.setGender((String) mapdata.get("field_Jad9u__c"));
            traceTable.setAge((String) mapdata.get("field_5F73u__c"));
            traceTable.setProfessional((String) mapdata.get("field_c6g0x__c"));
            traceTable.setURole((String) mapdata.get("field_KbGgb__c"));
            //traceTable.setStoreTime(String.valueOf(mapdata.get("field_x6eyi__c")));

            Object field_x6eyi__c = mapdata.get("field_x6eyi__c");
            if (field_x6eyi__c != null) {
                Timestamp timestamp1 = new Timestamp(new Double((Double) field_x6eyi__c).longValue());
                traceTable.setStoreTime(timestamp1);
            } else {
                traceTable.setStoreTime(null);
            }


            // traceTable.setDepartureTime(String.valueOf(mapdata.get("field_6d1RP__c")));

            Object field_6d1RP__c = mapdata.get("field_6d1RP__c");
            if (field_6d1RP__c != null) {
                Timestamp timestamp1 = new Timestamp(new Double((Double) field_6d1RP__c).longValue());
                traceTable.setDepartureTime(timestamp1);
            } else {
                traceTable.setDepartureTime(null);
            }

            traceTable.setReceptionTime((String) mapdata.get("field_9L6kp__c"));


            //traceTable.setSynergyNames((String)(mapdata.get("field_2Q85H__c")));

            Object field_2Q85H__c = mapdata.get("field_2Q85H__c");
            if (field_2Q85H__c != null) {
                String s = String.valueOf(mapdata.get("field_2Q85H__c"));
                traceTable.setSynergyNames(s);
            } else {
                traceTable.setSynergyNames(null);
            }

            traceTable.setNOCustomers((String) mapdata.get("field_6Pp98__c"));
            traceTable.setLevel((String) mapdata.get("field_cmkn6__c"));
            traceTable.setPosition((String) mapdata.get("field_DqB47__c"));
            traceTable.setBRecognition((String) mapdata.get("field_9551K__c"));
            traceTable.setAPBuy((String) mapdata.get("field_sI2Te__c"));
            traceTable.setUnit((String) mapdata.get("field_bc2oG__c"));
            traceTable.setStyle((String) mapdata.get("field_n72u9__c"));
            traceTable.setFigure((String) mapdata.get("field_K5zgl__c"));
            traceTable.setODrawings((String) mapdata.get("field_3frlw__c"));
            traceTable.setSituation((String) mapdata.get("field_250Dk__c"));
            traceTable.setInstructions((String) mapdata.get("field_CgXC5__c"));
            traceTable.setPCategory((String) mapdata.get("field_ZdA1t__c"));
            traceTable.setAChannel((String) mapdata.get("field_yAxp5__c"));
            traceTable.setAStores((String) mapdata.get("field_5ZkrK__c"));
            traceTable.setOChannel(String.valueOf(mapdata.get("field_Kk22a__c")));
            //traceTable.setUnawaresName((String)(mapdata.get("field_vHP16__c")));
            Object field_vHP16__c = mapdata.get("field_vHP16__c");
            if (field_vHP16__c != null) {
                String s = String.valueOf(field_vHP16__c);
                traceTable.setUnawaresName(s);
            } else {
                traceTable.setUnawaresName(null);
            }

            traceTable.setMActivities((String) mapdata.get("marketing_activity_id__c"));
            traceTable.setInvitation((String) mapdata.get("field_rW2hQ__c"));
            traceTable.setSChannel((String) mapdata.get("field_6oqSk__c"));//进店渠道
            // traceTable.setBTime(String.valueOf(mapdata.get("field_Qx9bo__c")));

            Object field_Qx9bo__c = mapdata.get("field_Qx9bo__c");
            if (field_Qx9bo__c != null) {
                Timestamp timestamp1 = new Timestamp(new Double((Double) field_Qx9bo__c).longValue());
                traceTable.setBTime(timestamp1);
            } else {
                traceTable.setBTime(null);
            }
            traceTable.setBudget(((String) mapdata.get("fiel.field_Oe4i2__c")));
            traceTable.setDProgress((String) mapdata.get("field_Wkidt__c"));
            traceTable.setArea((String) mapdata.get("field_LH25F__c"));
            traceTable.setCIdentity((String) mapdata.get("field_RbtKc__c"));
            traceTable.setPersonality((String) mapdata.get("field_5VDdh__c"));
            traceTable.setFSituation((String) mapdata.get("field_y6r17__c"));
            traceTable.setCompany((String) mapdata.get("field_62ymf__c"));
            traceTable.setPName((String) mapdata.get("field_91M3w__c"));
            traceTable.setPPhone((String) mapdata.get("field_pqw05__c"));
            traceTable.setAnalyse((String) mapdata.get("field_01995__c"));
            traceTable.setReview((String) mapdata.get("field_r682v__c"));
            traceTable.setDMaker((String) mapdata.get("field_39qjb__c"));
            traceTable.setDMakerInformation((String) mapdata.get("field_2dxC4__c"));
            traceTable.setCUnit((String) mapdata.get("field_gsfHb__c"));
            traceTable.setMName((String) mapdata.get("field_hRNms__c"));
            traceTable.setMPhone((String) mapdata.get("field_dZqRf__c"));
            traceTable.setUBrand((String) mapdata.get("field_22gPd__c"));
            traceTable.setBMaterials((String) mapdata.get("field_xIb39__c"));
            traceTable.setVName((String) mapdata.get("field_Bi94u__c"));
            traceTable.setHNamberf((String) mapdata.get("field_khUov__c"));
            traceTable.setPPhase((String) mapdata.get("field_2IR0a__c"));
            //traceTable.setClerkAssistant(String.valueOf(mapdata.get("field_J9eLo__c")));

            Object field_J9eLo__c = mapdata.get("field_J9eLo__c");
            if (field_J9eLo__c != null) {
                String s = String.valueOf(field_J9eLo__c);
                traceTable.setClerkAssistant(s);
            } else {
                traceTable.setClerkAssistant(null);
            }

            // traceTable.setFLogs(String.valueOf(mapdata.get("field_deOyY__c")));
            Object field_deOyY__c = mapdata.get("field_deOyY__c");
            if (field_deOyY__c != null) {
                String s = String.valueOf(field_deOyY__c);
                traceTable.setFLogs(s);
            } else {
                traceTable.setFLogs(null);
            }


            // traceTable.setFTime(String.valueOf(mapdata.get("field_aOcz2__c")));

            Object field_aOcz2__c = mapdata.get("field_aOcz2__c");
            if (field_aOcz2__c != null) {
                Timestamp timestamp1 = new Timestamp(new Double((Double) field_aOcz2__c).longValue());
                traceTable.setFTime(timestamp1);
            } else {
                traceTable.setFTime(null);
            }

            //traceTable.setFDrafte(String.valueOf(mapdata.get("field_oq6oM__c")));


            Object field_oq6oM__c = mapdata.get("field_oq6oM__c");
            if (field_oq6oM__c != null) {
                Timestamp timestamp1 = new Timestamp(new Double((Double) field_oq6oM__c).longValue());
                traceTable.setFDrafte(timestamp1);
            } else {
                traceTable.setFDrafte(null);
            }

            traceTable.setFStage((String) mapdata.get("field_VTT2w__c"));
            //traceTable.setFBudgetTime((String) mapdata.get("field_MF6g3__c"));

            Object field_MF6g3__c = mapdata.get("field_MF6g3__c");
            if (field_MF6g3__c != null) {
                Timestamp timestamp1 = new Timestamp(new Double((Double) field_MF6g3__c).longValue());
                traceTable.setFBudgetTime(timestamp1);
            } else {
                traceTable.setFBudgetTime(null);
            }

            traceTable.setQBLog((String) mapdata.get("field_7hu16__c"));
            traceTable.setFPLog((String) mapdata.get("field_Aiku4__c"));


            //traceTable.setSTime(String.valueOf(mapdata.get("field_5428s__c")));

            Object field_5428s__c = mapdata.get("field_5428s__c");
            if (field_5428s__c != null) {
                Timestamp timestamp1 = new Timestamp(new Double((Double) field_5428s__c).longValue());
                traceTable.setSTime(timestamp1);
            } else {
                traceTable.setSTime(null);
            }

            traceTable.setBAmount((String) mapdata.get("field_l0F22__c"));
            traceTable.setSLog((String) mapdata.get("field_nY9ir__c"));
            traceTable.setSPhase((String) mapdata.get("field_UHt0H__c"));

            // traceTable.setSReason(String.valueOf(mapdata.get("field_Evv15__c")));
            Object field_Evv15__c = mapdata.get("field_Evv15__c");
            if (field_Evv15__c != null) {
                String s = String.valueOf(field_Evv15__c);
                traceTable.setSReason(s);
            } else {
                traceTable.setSReason(null);
            }


            traceTable.setDissectCause((String) mapdata.get("field_cu1nc__c"));
            traceTable.setResponsibility((String) mapdata.get("field_bwwht__c"));
            traceTable.setDBudget((String) mapdata.get("field_8g1zG__c"));
            traceTable.setFamilyVisit(String.valueOf(mapdata.get("field_2QanG__c")));

            //traceTable.setOTime(String.valueOf(mapdata.get("field_o71dz__c")));

            Object field_o71dz__c = mapdata.get("field_o71dz__c");
            if (field_o71dz__c != null) {
                Timestamp timestamp1 = new Timestamp(new Double((Double) field_o71dz__c).longValue());
                traceTable.setOTime(timestamp1);
            } else {
                traceTable.setOTime(null);
            }

            traceTable.setMAppointment(String.valueOf(mapdata.get("field_48LmE__c")));
            traceTable.setCustomerName((String) mapdata.get("field_4dp2S__c"));
            traceTable.setContractTitle((String) mapdata.get("field_mIMvy__c"));
            traceTable.setContractNo((String) mapdata.get("field_un6Yi__c"));
            traceTable.setDiscount((String) mapdata.get("field_NYhF9__c"));
            traceTable.setWholeCase(String.valueOf(mapdata.get("field_7Hxmn__c")));
            traceTable.setFullSetOf(String.valueOf(mapdata.get("field_1h57w__c")));
            traceTable.setProportion((String) mapdata.get("field_BAXl3__c"));
            traceTable.setDeposit1((String) mapdata.get("field_sedP6__c"));
            traceTable.setDeposit2((String) mapdata.get("field_7KsE6__c"));
            traceTable.setBType((String) mapdata.get("field_Sxjtt__c"));
            traceTable.setNName((String) mapdata.get("field_t4Mc8__c"));
            //traceTable.setEAttachment(String.valueOf(mapdata.get("field_xKgN9__c")));

            Object field_xKgN9__c = mapdata.get("field_xKgN9__c");
            if (field_xKgN9__c != null) {
                String s = String.valueOf(field_xKgN9__c);
                traceTable.setEAttachment(s);
            } else {
                traceTable.setEAttachment(null);
            }

            traceTable.setPricDiscount(String.valueOf(mapdata.get("field_71iJA__c")));
            //traceTable.setContractDate(String.valueOf(mapdata.get("field_8jFi3__c")));

            Object field_8jFi3__c = mapdata.get("field_8jFi3__c");
            if (field_8jFi3__c != null) {
                String s = String.valueOf(field_8jFi3__c);
                traceTable.setContractDate(s);
            } else {
                traceTable.setContractDate(null);
            }

            //traceTable.setPromoter(String.valueOf(mapdata.get("marketing_spread_user__c")));

            Object marketing_spread_user__c = mapdata.get("marketing_spread_user__c");
            if (marketing_spread_user__c != null) {
                String s = String.valueOf(marketing_spread_user__c);
                traceTable.setPromoter(s);
            } else {
                traceTable.setPromoter(null);
            }


            traceTable.setTelephoneNumber((String) mapdata.get("field_wT2zc__c"));
            traceTable.setWeChat((String) mapdata.get("field_WqqZG__c"));
            traceTable.setSerialNumber((String) mapdata.get("field_z06l7__c"));
            traceTable.setStatisticalNumber((String) mapdata.get("field_tq141__c"));
            traceTable.setOwnerRole((String) mapdata.get("field_Bu8q9__c"));
            traceTable.setProjectArea((String) mapdata.get("field_eglCp__c"));
            traceTable.setCycle((String) mapdata.get("field_jr63A__c"));
            traceTable.setOSerial((String) mapdata.get("field_t3rN8__c"));
            traceTable.setCSerial((String) mapdata.get("field_Ylasv__c"));
            traceTable.setSigningCycle((String) mapdata.get("field_2Eyng__c"));
            traceTable.setFBudget((String) mapdata.get("field_d7401__c"));
            traceTable.setUUniqueIdentifier((String) mapdata.get("field_imP2k__c"));
            // traceTable.setSDate(String.valueOf(mapdata.get("field_i2Xfe__c")));

            Object field_i2Xfe__c = mapdata.get("field_i2Xfe__c");
            if (field_i2Xfe__c != null) {
                Timestamp timestamp1 = new Timestamp(new Double((Double) field_i2Xfe__c).longValue());
                traceTable.setSDate(timestamp1);
            } else {
                traceTable.setSDate(null);
            }

            traceTable.setDesigner((String) mapdata.get("field_amEfK__c"));
            traceTable.setDCompany((String) mapdata.get("field_wlcl4__c"));
            traceTable.setDReferees((String) mapdata.get("field_UbSl6__c"));
            traceTable.setDCompanyName((String) mapdata.get("field_C3IKn__c"));
            traceTable.setRCompanyName((String) mapdata.get("field_w01LC__c"));
            // traceTable.setRDesigner(String.valueOf(mapdata.get("field_O2b0V__c")));

            Object field_O2b0V__c = mapdata.get("field_O2b0V__c");
            if (field_O2b0V__c != null) {
                String s = String.valueOf(field_O2b0V__c);
                traceTable.setRDesigner(s);
            } else {
                traceTable.setRDesigner(null);
            }

            traceTable.setPDirector(String.valueOf(mapdata.get("field_cXJfk__c")));
            traceTable.setPDirector((String) mapdata.get("field_18Fdu__c"));
            //traceTable.setCProject(String.valueOf(mapdata.get("field_skfU1__c")));
            Object field_skfU1__c = mapdata.get("field_skfU1__c");
            if (field_skfU1__c != null) {
                Timestamp timestamp1 = new Timestamp(new Double((Double) field_skfU1__c).longValue());
                traceTable.setCProject(timestamp1);
            } else {
                traceTable.setCProject(null);
            }

            traceTable.setDeposit((String) mapdata.get("field_5qgbF__c"));
            traceTable.setExpectSbMoney((String) mapdata.get("field_00mEe__c"));
            traceTable.setPRating((String) mapdata.get("field_700xb__c"));
            //traceTable.setTimeToAssess(String.valueOf(mapdata.get("field_2S15e__c")));
            Object field_2S15e__c = mapdata.get("field_2S15e__c");
            if (field_2S15e__c != null) {
                String s = String.valueOf(field_2S15e__c);
                traceTable.setTimeToAssess(s);
            } else {
                traceTable.setTimeToAssess(null);
            }

            traceTable.setDrawingAttachment((String) mapdata.get("field_201aK__c"));
            //traceTable.setDecorateType(String.valueOf(mapdata.get("field_jbiMm__c")));

            Object field_jbiMm__c = mapdata.get("field_jbiMm__c");
            if (field_jbiMm__c != null) {
                String s = String.valueOf(field_jbiMm__c);
                traceTable.setDecorateType(s);
            } else {
                traceTable.setDecorateType(null);
            }

            traceTable.setCompeting((String) mapdata.get("field_D24t2__c"));
            traceTable.setCompetingSituation((String) mapdata.get("field_m9YVs__c"));
            traceTable.setRelatedCompeting((String) mapdata.get("related_competing"));
            traceTable.setMarriage((String) mapdata.get("field_2WsxS__c"));
            traceTable.setUsersOf((String) mapdata.get("field_97Sbg__c"));
            traceTable.setBudgetAccounted((String) mapdata.get("field_3IkmL__c"));
            //traceTable.setSpatialPlanning((String) mapdata.get("field_aXid5__c"));
            Object field_aXid5__c = mapdata.get("field_aXid5__c");
            if (field_aXid5__c != null) {
                String s = String.valueOf(field_aXid5__c);
                traceTable.setSpatialPlanning(s);
            } else {
                traceTable.setSpatialPlanning(null);
            }
            traceTable.setCustomerDemand((String) mapdata.get("field_sd50O__c"));
            traceTable.setRegistrationSource((String) mapdata.get("field_Cmt7y__c"));
            traceTable.setOCenterClues((String) mapdata.get("field_9f856__c"));
            traceTable.setMCluesLog((String) mapdata.get("field_6hp98__c"));
            //traceTable.setSalesDirector((String.valueOf(mapdata.get("field_2Y389__c"))));

            Object field_2Y389__c = mapdata.get("field_2Y389__c");
            if (field_2Y389__c != null) {
                String s = String.valueOf(field_2Y389__c);
                traceTable.setSalesDirector(s);
            } else {
                traceTable.setSalesDirector(null);
            }

            traceTable.setCluesState((String) mapdata.get("field_3Mstj__c"));
            traceTable.setProjectAddress((String) mapdata.get("field_422b8__c"));
            //traceTable.setCreationTime((String.valueOf(mapdata.get("create_time"))));

            Object create_time = mapdata.get("create_time");
            if (create_time != null) {
                Timestamp timestamp1 = new Timestamp(new Double((Double) create_time).longValue());
                traceTable.setCreationTime(timestamp1);
            } else {
                traceTable.setCreationTime(null);
            }

            //traceTable.setFounder((mapdata.get("created_by")).toString());
            Object created_by = mapdata.get("created_by");
            if (created_by != null) {
                String s = String.valueOf(mapdata.get("created_by"));
                traceTable.setFounder(s);
            } else {
                traceTable.setFounder(null);
            }
            //traceTable.setLastModifiedTime((String.valueOf(mapdata.get("last_modified_time"))));
            Object last_modified_time = mapdata.get("last_modified_time");
            if (last_modified_time != null) {
                Timestamp timestamp1 = new Timestamp(new Double((Double) last_modified_time).longValue());
                traceTable.setLastModifiedTime(timestamp1);
            } else {
                traceTable.setLastModifiedTime(null);
            }

            // traceTable.setAttributionDepartment((String.valueOf(mapdata.get("data_own_department"))));

            Object data_own_department = mapdata.get("data_own_department");
            if (data_own_department != null) {
                String s = String.valueOf(data_own_department);
                traceTable.setAttributionDepartment(s);
            } else {
                traceTable.setAttributionDepartment(null);
            }

            // traceTable.setLastModifier((mapdata.get("last_modified_by")).toString());

            Object last_modified_by = mapdata.get("last_modified_by");
            if (last_modified_by != null) {
                String s = String.valueOf(last_modified_by);
                traceTable.setLastModifier(s);
            } else {
                traceTable.setLastModifier(null);
            }

            //traceTable.setDistributionManager((String.valueOf(mapdata.get("assigner_id"))));

            Object assigner_id = mapdata.get("assigner_id");
            if (assigner_id != null) {
                String s = String.valueOf(assigner_id);
                traceTable.setDistributionManager(s);
            } else {
                traceTable.setDistributionManager(null);
            }

            //traceTable.setConversionTime((String.valueOf(mapdata.get("transform_time"))));

            Object transform_time = mapdata.get("transform_time");
            if (transform_time != null) {
                Timestamp timestamp1 = new Timestamp(new Double((Double) transform_time).longValue());
                traceTable.setConversionTime(timestamp1);
            } else {
                traceTable.setConversionTime(null);
            }

            traceTable.setOwnerDepartment((String) mapdata.get("owner_department"));
            traceTable.setLastFollower(((String.valueOf(mapdata.get("last_follower")))));
            //traceTable.setOwnerChangeTime(((String.valueOf(mapdata.get("owner_change_time")))));

            Object owner_change_time = mapdata.get("owner_change_time");
            if (owner_change_time != null) {
                Timestamp timestamp1 = new Timestamp(new Double((Double) owner_change_time).longValue());
                traceTable.setOwnerChangeTime(timestamp1);
            } else {
                traceTable.setOwnerChangeTime(null);
            }

            traceTable.setExternalSources((String) mapdata.get("out_resources"));
            // traceTable.setAllocateTime(((String.valueOf(mapdata.get("assigned_time")))));

            Object assigned_time = mapdata.get("assigned_time");
            if (assigned_time != null) {
                Timestamp timestamp1 = new Timestamp(new Double((Double) assigned_time).longValue());
                traceTable.setAllocateTime(timestamp1);
            } else {
                traceTable.setAllocateTime(null);
            }

            traceTable.setIsOvertime(((String.valueOf(mapdata.get("is_overtime")))));
            //traceTable.setHead(((String.valueOf(mapdata.get("ShopExcel")))));

            Object owner = mapdata.get("ShopExcel");
            if (owner != null) {
                String s = String.valueOf(owner);
                traceTable.setHead(s);
            } else {
                traceTable.setHead(null);
            }

            traceTable.setLocked((String) mapdata.get("lock_status"));
            traceTable.setProcessingResults((String) mapdata.get("completed_result"));
            traceTable.setBusinessTypes((String) mapdata.get("record_type"));
            //traceTable.setLastFollowTime((String.valueOf(mapdata.get("last_follow_time"))));

            Object last_follow_time = mapdata.get("last_follow_time");
            if (last_follow_time != null) {
                Timestamp timestamp1 = new Timestamp(new Double((Double) last_follow_time).longValue());
                traceTable.setLastFollowTime(timestamp1);
            } else {
                traceTable.setLastFollowTime(null);
            }

            traceTable.setState((String) mapdata.get("leads_status"));
            traceTable.setBizState((String) mapdata.get("biz_status"));
            //traceTable.setRecyclingTime((String) mapdata.get("expire_time"));

            Object expire_time = mapdata.get("expire_time");
            if (expire_time != null) {
                Timestamp timestamp1 = new Timestamp(new Double((Double) expire_time).longValue());
                traceTable.setRecyclingTime(timestamp1);
            } else {
                traceTable.setRecyclingTime(null);
            }

            //traceTable.setRemainingTime((String) mapdata.get("remaining_time"));

            Object remaining_time = mapdata.get("remaining_time");

            if (StringUtils.isNotBlank(remaining_time.toString())) {
                Timestamp timestamp1 = new Timestamp(new Double((Double) remaining_time).longValue());

                traceTable.setRemainingTime(timestamp1);
            } else {
                traceTable.setRemainingTime(null);
            }

            traceTable.setLifeStatus((String) mapdata.get("life_status"));

            //traceTable.setTakeBackTime((String.valueOf(mapdata.get("returned_time"))));

            Object returned_time = mapdata.get("returned_time");
            if (returned_time != null) {
                Timestamp timestamp1 = new Timestamp(new Double((Double) returned_time).longValue());
                traceTable.setTakeBackTime(timestamp1);
            } else {
                traceTable.setTakeBackTime(null);
            }

           /* SimpleDateFormat formatter= new SimpleDateFormat("yyyy-MM-dd 'at' HH:mm:ss z");
            Date date = new Date(System.currentTimeMillis());
            traceTable.setReceptionTime(formatter.format(date));*/

            traceTable.setRecTimeStamp(time);


            Object field_9Ioh1__c = mapdata.get("field_9Ioh1__c");
            if (field_9Ioh1__c != null) {
                Timestamp timestamp1 = new Timestamp(new Double((Double) field_9Ioh1__c).longValue());
                traceTable.setDTime(timestamp1);
            } else {
                traceTable.setTakeBackTime(null);
            }
            traceTable.setTraceTableId((String) mapdata.get("_id"));
            traceTable.setCountry((String) mapdata.get("field_7mdrt__c"));
            traceTable.setProvince((String) mapdata.get("field_18cem__c"));
            traceTable.setCityCode((String) mapdata.get("field_fUV5c__c"));
            traceTable.setRegion((String) mapdata.get("field_7IT2a__c"));


            //添加数据到集合
            targetList.add(traceTable);
        }
        return targetList;
    }


    //TODO 合同接口(IntfContract)
    public List<IntfContract> getTotalAndInfContract(Integer offset, Integer limit) {
        //定义List集合
        List<IntfContract> contractList = new ArrayList<>();
        Map map = fenXiangInterface();
       /* String param = "{\n" +
                "  \"corpAccessToken\": \"" + map.get("corpAccessToken") + "\",\n" +
                "  \"corpId\": \"" + map.get("corpId") + "\",\n" +
                "  \"currentOpenUserId\": \"" + openUserId + "\",\n" +
                "   \"data\": {\n" +
                "    \"search_query_info\": {\n" +
                "      \"offset\": " + offset + ",\n" +
                "      \"limit\":  " + limit + ",\n" +
                "      \"filters\": []\n" +
                "    },\n" +
                "    \"dataObjectApiName\": \"ContractObj\"\n" +
                "  }\n" +
                "}";*/
        String param = "{\n" +
                "    \"corpAccessToken\": \"" + map.get("corpAccessToken") + "\",\n" +
                "    \"corpId\": \"" + map.get("corpId") + "\",\n" +
                "    \"currentOpenUserId\": \"" + openUserId + "\",\n" +
                "    \"data\": {\n" +
                "    \"search_query_info\": {\n" +
                "      \"offset\": " + offset + ",\n" +
                "      \"limit\": " + limit + ",\n" +
                "      \"filters\": [\n" +
                "           {\n" +
                "                    \"field_name\": \"create_time\",\n" +
                "                    \"field_values\": [\n" +
                "                        \"1598889600000\"\n" +
                "                    ],\n" +
                "                    \"operator\": \"GT\"\n" +
                "                }\n" +
                "      ]\n" +
                "    },\n" +
                "    \"dataObjectApiName\": \"ContractObj\"\n" +
                "  }\n" +
                "  }";

        //获取接口数据
        Map map2 = httpClientUtil.sendPostForJson("", param, urlTest2);

        //获取最终数据
        Map<String, Object> data = (Map<String, Object>) map2.get("data");
        ArrayList<Object> dataList = (ArrayList<Object>) data.get("dataList");
        //获取当前时间(实体类会赋值)
        Date date = new Date();
        DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String time = df.format(date);
        //遍历dataList
        for (int i = 0; i < dataList.size(); i++) {
            IntfContract entity = new IntfContract();
            Map<String, Object> mapdata = (Map<String, Object>) dataList.get(i);
            //设置数据
            entity.setContractHeadline((String) mapdata.get("name"));
            entity.setContractAmount((String) mapdata.get("contract_amount"));
            //entity.setExpiredTime((String) mapdata.get("expired_time"));
            Object expired_time = mapdata.get("expired_time");
            if (expired_time != null) {
                Timestamp timestamp1 = new Timestamp(new Double((Double) expired_time).longValue());
                entity.setExpiredTime(timestamp1);
            } else {
                entity.setExpiredTime(null);
            }
            entity.setContractTitle((String) mapdata.get("contract_title"));
            entity.setPartners((String) mapdata.get("partner_id"));
            Object started_time = mapdata.get("started_time");
            if (started_time != null) {
                Timestamp timestamp1 = new Timestamp(new Double((Double) started_time).longValue());
                entity.setStartedTime(timestamp1);
            } else {
                entity.setStartedTime(null);
            }
            entity.setCustomerName((String) mapdata.get("account_id"));
            entity.setBranch((String) mapdata.get("field_Ccaa8__c"));
            entity.setContractNumber((String) mapdata.get("field_6Px0g__c"));
            entity.setContractNature((String) mapdata.get("field_j3tHu__c"));
            entity.setOwnerDeposit((String) mapdata.get("field_YrH4F__c"));
            entity.setSignDiscount((String) mapdata.get("field_clg8Y__c"));
            entity.setDescr((String) mapdata.get("field_lfq45__c"));
            entity.setOwnerName((String) mapdata.get("field_N46DX__c"));
            entity.setOwnerPhone((String) mapdata.get("field_YQWn0__c"));
            entity.setOwnerAge((String) mapdata.get("field_u31ly__c"));
            entity.setOwnerProperty((String) mapdata.get("field_lv8m9__c"));
            entity.setOwnerIndustry((String) mapdata.get("field_2g3yh__c"));
            entity.setOwnerRole((String) mapdata.get("field_0vpls__c"));
            entity.setOwnerGender((String) mapdata.get("field_wD0Ad__c"));
            entity.setOwnerFamilyBackground((String) mapdata.get("field_s2ble__c"));
            entity.setContractReportedType((String) mapdata.get("field_4V10U__c"));
            //entity.setOwnerBirthday((String) mapdata.get("field_n33Tb__c"));
            Object field_n33Tb__c = mapdata.get("field_n33Tb__c");
            if (field_n33Tb__c != null) {
                Timestamp timestamp1 = new Timestamp(new Double((Double) field_n33Tb__c).longValue());
                entity.setOwnerBirthday(timestamp1);
            } else {
                entity.setOwnerBirthday(null);
            }

            entity.setWholeCaseSelect((String) mapdata.get("field_rB3Do__c"));
            entity.setMistakeMuli((String) mapdata.get("field_Jn1O6__c"));
            entity.setWholeCaseMistakeMuli((String) mapdata.get("field_4rnT7__c"));
            entity.setWholeCaseMistakeMuliName((String) mapdata.get("field_1Y7m8__c"));
            entity.setOwnerInformationSources((String) mapdata.get("field_p1e6H__c"));
            entity.setTraceTable((String) mapdata.get("field_1n7yk__c"));
            entity.setOrderType((String) mapdata.get("field_7bFr6__c"));
            entity.setWhetherCompleteOrder(String.valueOf(mapdata.get("field_b210Z__c")));
            entity.setWhetherDiscount((String.valueOf(mapdata.get("field_wnmpu__c"))));
            entity.setGender((String) mapdata.get("field_26Hnm__c"));
            entity.setHighResolutionAuthenticationCode((String) mapdata.get("field_T1q9C__c"));
            entity.setWholeCaseProportion((String) mapdata.get("field_ft47d__c"));
            entity.setOrderProductName((String) mapdata.get("field_kk86v__c"));
            entity.setOrderProductAmount((String) mapdata.get("field_C14sv__c"));
            entity.setWholeCaseProportionSum((Float) mapdata.get("field_Qf1wA__c%"));
            entity.setMistakeMuliSum((String) mapdata.get("field_W2i2j__c"));
            entity.setSoleIdentification((String) mapdata.get("field_bB8nY__c"));
            entity.setCustomerSource((String) mapdata.get("field_PKprO__c"));
            entity.setCorrespondenceCategory((String) mapdata.get("field_1x18n__c"));
            //entity.setServiceCharge((String) mapdata.get("field_1x18n__c"));
            Object field_1x18n__c = mapdata.get("field_1x18n__c");
            if (field_1x18n__c != null) {
                String s = String.valueOf(field_1x18n__c);
                entity.setServiceCharge(s);
            } else {
                entity.setServiceCharge(null);
            }
            //entity.setCreateTime(new Timestamp(new Double((Double) mapdata.get("create_time")).longValue()));

            Object create_time = mapdata.get("create_time");
            if (create_time != null) {
                Timestamp timestamp1 = new Timestamp(new Double((Double) create_time).longValue());
                entity.setCreateTime(timestamp1);
            } else {
                entity.setCreateTime(null);
            }
            //entity.setCreatedBy((mapdata.get("created_by")).toString());
            Object created_by = mapdata.get("created_by");
            if (created_by != null) {
                String s = String.valueOf(mapdata.get("created_by"));
                entity.setCreatedBy(s);
            } else {
                entity.setCreatedBy(null);
            }
            //entity.setOwnerDepartment((mapdata.get("data_own_department")).toString());
            Object data_own_department = mapdata.get("data_own_department");
            if (data_own_department != null) {
                String s = String.valueOf(mapdata.get("data_own_department"));
                entity.setOwnerDepartment(s);
            } else {
                entity.setOwnerDepartment(null);
            }
            entity.setOutOwner((String) mapdata.get("out_owner"));
            // entity.setLastModifiedTime(new Timestamp(new Double((Double) mapdata.get("last_modified_time")).longValue()));

            Object last_modified_time = mapdata.get("last_modified_time");
            if (last_modified_time != null) {
                Timestamp timestamp1 = new Timestamp(new Double((Double) last_modified_time).longValue());
                entity.setLastModifiedTime(timestamp1);
            } else {
                entity.setLastModifiedTime(null);
            }
            // entity.setLastModifiedBy((mapdata.get("last_modified_by")).toString());
            Object last_modified_by = mapdata.get("last_modified_by");
            if (last_modified_by != null) {
                String s = String.valueOf(mapdata.get("last_modified_by"));
                entity.setLastModifiedBy(s);
            } else {
                entity.setLastModifiedBy(null);
            }
            entity.setOutResources((String) mapdata.get("out_resources"));
            //entity.setOwner((mapdata.get("ShopExcel")).toString());
            Object ShopExcel = mapdata.get("ShopExcel");
            if (ShopExcel != null) {
                String s = String.valueOf(mapdata.get("ShopExcel"));
                entity.setOwner(s);
            } else {
                entity.setOwner(null);
            }
            entity.setLockStatus(Integer.parseInt((String) mapdata.get("lock_status")));
            entity.setLifeStatus((String) mapdata.get("life_status"));
            entity.setOwnerDepartment((String) mapdata.get("owner_department"));
            entity.setRecordType((String) mapdata.get("record_type"));
            entity.setStatus(Integer.parseInt((String) mapdata.get("status")));
            entity.setDepositAmount((String) mapdata.get("field_YrH4F__c"));
            entity.setTailAmount((String) mapdata.get("field_b26bd__c"));
            entity.setRecTimeStamp(time);
            //添加到list集合
            contractList.add(entity);
        }

        return contractList;
    }


    //TODO 负责人调用接口(IntfPrincipalService)
    public List<IntfPrincipal> getIntfprincipalData(Integer offect, Integer limit) {
        Map map = fenXiangInterface();
        String param = " {\n" +
                "    \"corpAccessToken\": \"" + map.get("corpAccessToken") + "\",\n" +
                "    \"corpId\": \"" + map.get("corpId") + "\",\n" +
                "    \"currentOpenUserId\": \"FSUID_42315E8605D5B50901B4366EAF2E5918\",\n" +
                "    \"data\": {\n" +
                "        \"dataObjectApiName\": \"PersonnelObj\",\n" +
                "        \"search_query_info\": {\n" +
                "            \"limit\": " + limit + ",\n" +
                "            \"offset\": " + offect + ",\n" +
                "            \"filters\": [],\n" +
                "            \"orders\": [\n" +
                "                {\n" +
                "                    \"fieldName\": \"create_time\",\n" +
                "                    \"isAsc\": false\n" +
                "                }\n" +
                "            ]\n" +
                "        }\n" +
                "    }\n" +
                "}  ";
        Map map4 = httpClientUtil.sendPostForJson("", param, urlTest2);


        //定义实体类集合
        List<IntfPrincipal> intfPrincipal = new ArrayList();

        //获取当前时间(实体类会赋值)
        Date date = new Date();
        DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String time1 = df.format(date);

        //获取最终数据
        Map<String, Object> data = (Map<String, Object>) map4.get("data");
        ArrayList<Object> dataList = (ArrayList<Object>) data.get("dataList");
        for (int i = 0; i < dataList.size(); i++) {
            Map<String, Object> mapdata = (Map<String, Object>) dataList.get(i);
            IntfPrincipal entiy = new IntfPrincipal();
            entiy.setName((String) mapdata.get("name"));
            //entiy.setLeader(String.valueOf(mapdata.get("leader")));

            Object leader = mapdata.get("leader");
            if (leader != null) {
                String s = String.valueOf(leader);
                entiy.setLeader(s);
            } else {
                entiy.setLeader(null);
            }

            //entiy.setCreateTime((Timestamp) mapdata.get("create_time"));
            Object create_time = mapdata.get("create_time");
            if (create_time != null) {
                Timestamp time = new Timestamp(new Double((double) create_time).longValue());
                entiy.setCreateTime(time);
            } else {
                entiy.setCreateTime(null);
            }
            entiy.setCreatedBy(String.valueOf(mapdata.get("created_by")));
            entiy.setDataOwnDepartment(String.valueOf(mapdata.get("data_own_department")));
            // entiy.setStopTime((Timestamp) mapdata.get("stop_time"));

            Object stop_time = mapdata.get("stop_time");
            if (stop_time != null) {
                Timestamp time = new Timestamp(new Double((double) stop_time).longValue());
                entiy.setStopTime(time);
            } else {
                entiy.setStopTime(null);
            }
            entiy.setUserName((String) mapdata.get("user_name"));
            entiy.setDescription((String) mapdata.get("description"));
            //entiy.setLastModifiedTime((Timestamp) mapdata.get("last_modified_time"));
            Object last_modified_time = mapdata.get("last_modified_time");
            if (last_modified_time != null) {
                Timestamp time = new Timestamp(new Double((double) last_modified_time).longValue());
                entiy.setLastModifiedTime(time);
            } else {
                entiy.setLastModifiedTime(null);
            }
            entiy.setLastModifiedBy(String.valueOf(mapdata.get("last_modified_by")));
            entiy.setOwnerDepartment((String) mapdata.get("owner_department"));
            // entiy.setViceDepartments(String.valueOf(mapdata.get("vice_departments")));

            Object vice_departments = mapdata.get("vice_departments");
            if (vice_departments != null) {
                String s = String.valueOf(vice_departments);
                entiy.setViceDepartments(s);
            } else {
                entiy.setViceDepartments(null);
            }
            entiy.setEmail((String) mapdata.get("email"));
            entiy.setOwner(String.valueOf(mapdata.get("ShopExcel")));
            entiy.setLockStatus((String) mapdata.get("lock_status"));
            entiy.setIsActive(String.valueOf(mapdata.get("is_active")));
            entiy.setLifeStatus(String.valueOf(mapdata.get("life_status")));
            entiy.setSex((String) mapdata.get("sex"));
            entiy.setMain_department(String.valueOf(mapdata.get("main_department")));
            //entiy.setIsPauseLogin(String.valueOf(mapdata.get("is_pause_login")));
            Object is_pause_login = mapdata.get("is_pause_login");
            if (is_pause_login != null) {
                String s = String.valueOf(is_pause_login);
                entiy.setIsPauseLogin(s);
            } else {
                entiy.setIsPauseLogin(null);
            }
            entiy.setFullName((String) mapdata.get("full_name"));
            entiy.setUserId((String) mapdata.get("user_id"));
            // entiy.setDateOfJoining((Timestamp) mapdata.get("date_of_joining"));

            Object date_of_joining = mapdata.get("date_of_joining");
            if (date_of_joining != null) {
                Timestamp time = new Timestamp(new Double((double) date_of_joining).longValue());
                entiy.setDateOfJoining(time);
            } else {
                entiy.setDateOfJoining(null);
            }
            entiy.setEmployeeNumber((String) mapdata.get("employee_number"));
            entiy.setPosition((String) mapdata.get("position"));
            entiy.setRecordType((String) mapdata.get("record_type"));
            entiy.setStatus((String) mapdata.get("status"));
            entiy.setSaml2NameId((String) mapdata.get("saml2_name_id"));
            entiy.setPhone((String) mapdata.get("phone"));
            entiy.setRecTimeStamp(time1);
            intfPrincipal.add(entiy);
        }
        return intfPrincipal;
    }


    //TODO 市场活动调用接口
    public List<IntfMarketingActivity> getmarketingActivity(Integer offect, Integer limit) {
        Map map = fenXiangInterface();
        String param = "{\n" +
                "  \"corpAccessToken\": \"" + map.get("corpAccessToken") + "\",\n" +
                "  \"corpId\": \"" + map.get("corpId") + "\",\n" +
                "  \"currentOpenUserId\": \"" + openUserId + "\",\n" +
                "  \"data\": {\n" +
                "    \"search_query_info\": {\n" +
                "      \"offset\": " + offect + ",\n" +
                "      \"limit\": " + limit + ",\n" +
                "      \"filters\": []\n" +
                "    },\n" +
                "    \"dataObjectApiName\": \"MarketingEventObj\"\n" +
                "  }\n" +
                "}";
        Map mp5 = httpClientUtil.sendPostForJson("", param, urlTest2);

        //定义实体类集合
        List<IntfMarketingActivity> IntfMarketingActivity = new ArrayList<IntfMarketingActivity>();

        //获取当前时间(实体类会赋值)
        Date date = new Date();
        DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String time1 = df.format(date);

        //获取最终数据
        Map<String, Object> data = (Map<String, Object>) mp5.get("data");
        ArrayList<Object> dataList = (ArrayList<Object>) data.get("dataList");
        for (Object o : dataList) {
            //ArrayList集合转map集合
            Map<String, Object> mapdata = (Map<String, Object>) o;
            IntfMarketingActivity entity = new IntfMarketingActivity();
            entity.setActivityName((String) (mapdata.get("name")));
            entity.setDescription((String) (mapdata.get("description")));
            entity.setExecutionDesc((String) (mapdata.get("execution_desc")));
            entity.setPartnerId((String) (mapdata.get("partner_id")));
            entity.setEventType((String) (mapdata.get("event_type")));


            //entity.setExpectedCost((String)(mapdata.get("expected_cost")));
            Object expected_cost = mapdata.get("expected_cost");
            if (expected_cost != null) {
                entity.setExpectedCost(Double.parseDouble((String) expected_cost));
            } else {
                entity.setExpectedCost(Double.valueOf(0));
            }


            entity.setMarketingPlan((String) (mapdata.get("marketing_plan")));
            entity.setSummary((String) (mapdata.get("summary")));
            entity.setBizStatus((String) (mapdata.get("biz_status")));
            //entity.setExpectedIncome((String)(mapdata.get("expected_income")));

            Object expected_income = mapdata.get("expected_income");
            if (expected_income != null) {
                entity.setExpectedIncome(Double.parseDouble((String) expected_income));
            } else {
                entity.setExpectedIncome(Double.valueOf(0));
            }

            //entity.setEndTime(String.valueOf(mapdata.get("end_time")));

            Object end_time = mapdata.get("end_time");
            if (end_time != null) {
                Timestamp time = new Timestamp(new Double((double) end_time).longValue());
                entity.setEndTime(time);
            } else {
                entity.setEndTime(null);
            }

            // entity.setBeginTime(String.valueOf(mapdata.get("begin_time")));

            Object begin_time = mapdata.get("begin_time");
            if (begin_time != null) {
                Timestamp time = new Timestamp(new Double((double) begin_time).longValue());
                entity.setBeginTime(time);
            } else {
                entity.setBeginTime(null);
            }

            //entity.setActualIncome((String)(mapdata.get("actual_income")));

            Object actual_income = mapdata.get("actual_income");
            if (actual_income != null) {
                entity.setActualIncome(Double.parseDouble((String) actual_income));
            } else {
                entity.setActualIncome(Double.valueOf(0));
            }

            //entity.setActualCost((String)(mapdata.get("actual_cost")));

            Object actual_cost = mapdata.get("actual_cost");
            if (actual_cost != null) {
                entity.setActualCost(Double.parseDouble((String) actual_cost));
            } else {
                entity.setActualCost(Double.valueOf(0));
            }


            entity.setEffect((String) (mapdata.get("effect")));
            entity.setLocation((String) (mapdata.get("location")));
            entity.setOutOwner((String) (mapdata.get("out_owner")));
            //entity.setLastModifiedTime(String.valueOf(mapdata.get("last_modified_time")));

            Object last_modified_time = mapdata.get("last_modified_time");
            if (begin_time != null) {
                Timestamp time = new Timestamp(new Double((double) last_modified_time).longValue());
                entity.setLastModifiedTime(time);
            } else {
                entity.setLastModifiedTime(null);
            }

            // entity.setCreateTime(String.valueOf(mapdata.get("create_time")));

            Object create_time = mapdata.get("create_time");
            if (create_time != null) {
                Timestamp time = new Timestamp(new Double((double) create_time).longValue());
                entity.setCreateTime(time);
            } else {
                entity.setCreateTime(null);
            }

            //entity.setLastModifiedBy((String)(mapdata.get("last_modified_by")));
            Object last_modified_by = mapdata.get("last_modified_by");
            if (last_modified_by != null) {
                String s = String.valueOf(last_modified_by);
                entity.setLastModifiedBy(s);
            } else {
                entity.setLastModifiedBy(null);
            }

            //entity.setCreatedBy((String)(mapdata.get("created_by")));
            Object created_by = mapdata.get("created_by");
            if (created_by != null) {
                String s = String.valueOf(created_by);
                entity.setCreatedBy(s);
            } else {
                entity.setCreatedBy(null);
            }

            //entity.setDataOwnDepartment((String)(mapdata.get("data_own_department")));

            Object data_own_department = mapdata.get("data_own_department");
            if (data_own_department != null) {
                String s = String.valueOf(data_own_department);
                entity.setDataOwnDepartment(s);
            } else {
                entity.setDataOwnDepartment(null);
            }

            entity.setOwnerDepartment((String) (mapdata.get("owner_department")));
            //entity.setOwner((String)(mapdata.get("ShopExcel")));

            Object owner = mapdata.get("ShopExcel");
            if (owner != null) {
                String s = String.valueOf(owner);
                entity.setOwner(s);
            } else {
                entity.setOwner(null);
            }

            entity.setLockStatus((String) (mapdata.get("lock_status")));
            entity.setStatus((String) (mapdata.get("status")));
            entity.setLifeStatus((String) (mapdata.get("life_status")));
            entity.setRecordType((String) (mapdata.get("record_type")));
            entity.setOutResources((String) (mapdata.get("out_resources")));
            entity.setRecTimeStamp(time1);
            IntfMarketingActivity.add(entity);
        }


        return IntfMarketingActivity;
    }


    //TODO 客户接口
    public List<IntfClient> getClint(Integer offect, Integer limit) {
        Map map = fenXiangInterface();
        String param = "{\n" +
                "  \"corpAccessToken\": \"" + map.get("corpAccessToken") + "\",\n" +
                "  \"corpId\": \"" + map.get("corpId") + "\",\n" +
                "  \"currentOpenUserId\": \"" + openUserId + "\",\n" +
                "  \"data\": {\n" +
                "    \"search_query_info\": {\n" +
                "      \"offset\": " + offect + ",\n" +
                "      \"limit\": " + limit + ",\n" +
                "      \"filters\": []\n" +
                "    },\n" +
                "    \"dataObjectApiName\": \"AccountObj\"\n" +
                "  }\n" +
                "}";
        Map mp6 = httpClientUtil.sendPostForJson("", param, urlTest2);

        //定义实体类集合
        List<IntfClient> list = new ArrayList<IntfClient>();

        //获取当前时间(实体类会赋值)
        Date date = new Date();
        DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String time1 = df.format(date);

        //获取最终数据
        Map<String, Object> data = (Map<String, Object>) mp6.get("data");
        ArrayList<Object> dataList = (ArrayList<Object>) data.get("dataList");

        for (Object o : dataList) {
            Map<String, Object> mapdata = (Map<String, Object>) o;
            IntfClient entity = new IntfClient();
            entity.setName((String) mapdata.get("name"));
            entity.setAccountNo((String) mapdata.get(mapdata.get("account_no")));
            entity.setNextFollowedRemark((String) mapdata.get("next_followed_remark"));
            // entity.setIsErEnterprise((String) mapdata.get("is_er_enterprise"));
            Object is_er_enterprise = mapdata.get("is_er_enterprise");
            if (is_er_enterprise != null) {
                String s = String.valueOf(is_er_enterprise);
                entity.setIsErEnterprise(s);
            } else {
                entity.setIsErEnterprise(null);
            }
            entity.setUniformSocialCreditCode((String) mapdata.get("uniform_social_credit_code"));
            // entity.setBizRegName((String) mapdata.get("biz_reg_name"));
            Object biz_reg_name = mapdata.get("biz_reg_name");
            if (is_er_enterprise != null) {
                String s = String.valueOf(biz_reg_name);
                entity.setBizRegName(s);
            } else {
                entity.setBizRegName(null);
            }
            //entity.setNextFollowedTime((Timestamp) mapdata.get("next_followed_time"));
            Object next_followed_time = mapdata.get("next_followed_time");
            if (next_followed_time != null) {
                Timestamp time = new Timestamp(new Double((double) next_followed_time).longValue());
                entity.setNextFollowedTime(time);
            } else {
                entity.setNextFollowedTime(null);
            }
            entity.setAreaLocation((String) mapdata.get("area_location"));
            entity.setPhoneNumberAttribution((String) mapdata.get("phone_number_attribution"));
            entity.setParentAccountId((String) mapdata.get("parent_account_id"));
            entity.setAccountLevel((String) mapdata.get("account_level"));
            entity.setRemark((String) mapdata.get("remark"));
            entity.setPartnerId((String) mapdata.get("partner_id"));
            // entity.setUdAttach5C((String) mapdata.get("UDAttach5__c"));

            Object UDAttach5__c = mapdata.get("UDAttach5__c");
            if (UDAttach5__c != null) {
                String s = String.valueOf(UDAttach5__c);
                entity.setUdAttach5C(s);
            } else {
                entity.setUdAttach5C(null);
            }
            //entity.setUdDate13C((Timestamp) mapdata.get("UDDate13__c"));
            Object UDDate13__c = mapdata.get("UDDate13__c");
            if (UDDate13__c != null) {
                Timestamp time = new Timestamp(new Double((double) UDDate13__c).longValue());
                entity.setUdDate13C(time);
            } else {
                entity.setUdDate13C(null);
            }
            //entity.setUdAttach1C((String) mapdata.get("UDAttach1__c"));

            Object UDAttach1__c = mapdata.get("UDAttach1__c");
            if (UDAttach1__c != null) {
                String s = String.valueOf(mapdata.get("UDAttach1__c"));
                entity.setUdAttach1C(s);
            } else {
                entity.setUdAttach1C(null);
            }
            //entity.setUdMoney1C((Double) mapdata.get("UDMoney1__c"));

            Object udMoney1__c = mapdata.get("UDMoney1__c");
            if (udMoney1__c != null) {
                entity.setUdMoney1C(Double.parseDouble((String) udMoney1__c));
            } else {
                entity.setUdMoney1C(Double.valueOf(0));
            }

            //entity.setUdDate4C((Timestamp) mapdata.get("UDDate4__c"));
            Object UDDate4__c = mapdata.get("UDDate4__c");
            if (UDDate4__c != null) {
                Timestamp time = new Timestamp(new Double((double) UDDate4__c).longValue());
                entity.setUdDate4C(time);
            } else {
                entity.setUdDate4C(null);
            }
            entity.setUdStext2C((String) mapdata.get("UDSText2__c"));
            // entity.setUdDate8C((Timestamp) mapdata.get("UDDate8__c"));
            Object UDDate8__c = mapdata.get("UDDate8__c");
            if (UDDate8__c != null) {
                Timestamp time = new Timestamp(new Double((double) UDDate8__c).longValue());
                entity.setUdDate8C(time);
            } else {
                entity.setUdDate8C(null);
            }
            //entity.setUdAttach8C((String) mapdata.get("UDAttach8__c"));

            Object UDAttach8__c = mapdata.get("UDAttach8__c");
            if (UDAttach8__c != null) {
                String s = String.valueOf(mapdata.get("UDAttach8__c"));
                entity.setUdAttach8C(s);
            } else {
                entity.setUdAttach8C(null);
            }
            // entity.setUdImg1C((String) mapdata.get("UDImg1__c"));
            Object UDImg1__c = mapdata.get("UDImg1__c");
            if (UDImg1__c != null) {
                String s = String.valueOf(mapdata.get("UDImg1__c"));
                entity.setUdImg1C(s);
            } else {
                entity.setUdImg1C(null);
            }
            entity.setUdLookup3C((String) mapdata.get("UDLookUp3__c"));
            entity.setUdSsel3C((String) mapdata.get("UDSSel3__c"));
            //entity.setUdDate10C((Timestamp) mapdata.get("UDDate10__c"));
            Object UDDate10__c = mapdata.get("UDDate10__c");
            if (UDDate10__c != null) {
                Timestamp time = new Timestamp(new Double((double) UDDate10__c).longValue());
                entity.setUdDate10C(time);
            } else {
                entity.setUdDate10C(null);
            }
            entity.setUdSsel7C((String) mapdata.get("UDSSel7__c"));
            // entity.setUdAttach6C((String) mapdata.get("UDAttach6__c"));

            Object UDAttach6__c = mapdata.get("UDAttach6__c");
            if (UDAttach6__c != null) {
                String s = String.valueOf(mapdata.get("UDAttach6__c"));
                entity.setUdAttach6C(s);
            } else {
                entity.setUdAttach6C(null);
            }
            // entity.setUdDate14C((Timestamp) mapdata.get("UDDate14__c"));
            Object UDDate14__c = mapdata.get("UDDate14__c");
            if (UDDate14__c != null) {
                Timestamp time = new Timestamp(new Double((double) UDDate14__c).longValue());
                entity.setUdDate14C(time);
            } else {
                entity.setUdDate14C(null);
            }
            // entity.setUdAttach2C((String) mapdata.get("UDAttach2__c"));

            Object UDAttach2__c = mapdata.get("UDAttach2__c");
            if (UDAttach2__c != null) {
                String s = String.valueOf(mapdata.get("UDAttach2__c"));
                entity.setUdAttach2C(s);
            } else {
                entity.setUdAttach2C(null);
            }
            //entity.setUdImg2C((String) mapdata.get("UDImg2__c"));
            Object UDImg2__c = mapdata.get("UDImg2__c");
            if (UDImg2__c != null) {
                String s = String.valueOf(mapdata.get("UDImg2__c"));
                entity.setUdImg2C(s);
            } else {
                entity.setUdImg2C(null);
            }
            // entity.setUdDate1C((Timestamp) mapdata.get("UDDate1__c"));

            Object UDDate1__c = mapdata.get("UDDate1__c");
            if (UDDate1__c != null) {
                Timestamp time = new Timestamp(new Double((double) UDDate1__c).longValue());
                entity.setUdDate1C(time);
            } else {
                entity.setUdDate1C(null);
            }
            entity.setUdStext1C((String) mapdata.get("UDSText1__c"));
            // entity.setUdDate5C((Timestamp) mapdata.get("UDDate5__c"));
            Object UDDate5__c = mapdata.get("UDDate5__c");
            if (UDDate5__c != null) {
                Timestamp time = new Timestamp(new Double((double) UDDate5__c).longValue());
                entity.setUdDate5C(time);
            } else {
                entity.setUdDate5C(null);
            }
            //entity.setUdDate9C((Timestamp) mapdata.get("UDDate9__c"));
            Object UDDate9__c = mapdata.get("UDDate9__c");
            if (UDDate9__c != null) {
                Timestamp time = new Timestamp(new Double((double) UDDate9__c).longValue());
                entity.setUdDate9C(time);
            } else {
                entity.setUdDate9C(null);
            }
            entity.setUdSsel2C((String) mapdata.get("UDSSel2__c"));
            entity.setUdSsel6C((String) mapdata.get("UDSSel6__c"));
            // entity.setUdDate11C((Timestamp) mapdata.get("UDDate11__c"));
            Object UDDate11__c = mapdata.get("UDDate11__c");
            if (UDDate11__c != null) {
                Timestamp time = new Timestamp(new Double((double) UDDate11__c).longValue());
                entity.setUdDate11C(time);
            } else {
                entity.setUdDate11C(null);
            }
            // entity.setUdAttach3C((String) mapdata.get("UDAttach3__c"));

            Object UDAttach3__c = mapdata.get("UDAttach3__c");
            if (UDAttach3__c != null) {
                String s = String.valueOf(mapdata.get("UDAttach3__c"));
                entity.setUdAttach3C(s);
            } else {
                entity.setUdAttach3C(null);
            }
            //entity.setUdAttach7C((String) mapdata.get("UDAttach7__c"));
            Object UDAttach7__c = mapdata.get("UDAttach7__c");
            if (UDAttach7__c != null) {
                String s = String.valueOf(mapdata.get("UDAttach7__c"));
                entity.setUdAttach7C(s);
            } else {
                entity.setUdAttach7C(null);
            }
            entity.setUdSsel1C((String) mapdata.get("UDSSel1__c"));
            //entity.setUdDate2C((Timestamp) mapdata.get("UDDate2__c"));
            Object UDDate2__c = mapdata.get("UDDate2__c");
            if (UDDate2__c != null) {
                Timestamp time = new Timestamp(new Double((double) UDDate2__c).longValue());
                entity.setUdDate2C(time);
            } else {
                entity.setUdDate2C(null);
            }
            entity.setUdLookup1C((String) mapdata.get("UDLookUp1__c"));
            //entity.setUdDate6C((Timestamp) mapdata.get("UDDate6__c"));
            Object UDDate6__c = mapdata.get("UDDate6__c");
            if (UDDate6__c != null) {
                Timestamp time = new Timestamp(new Double((double) UDDate6__c).longValue());
                entity.setUdDate6C(time);
            } else {
                entity.setUdDate6C(null);
            }
            // entity.setUdDate12C((Timestamp) mapdata.get("UDDate12__c"));
            Object UDDate12__c = mapdata.get("UDDate12__c");
            if (UDDate12__c != null) {
                Timestamp time = new Timestamp(new Double((double) UDDate12__c).longValue());
                entity.setUdDate12C(time);
            } else {
                entity.setUdDate12C(null);
            }
            entity.setUdSsel5C((String) mapdata.get("UDSSel5__c"));
            entity.setUdMtext1C((String) mapdata.get("UDMText1__c"));
            //entity.setUdAttach4C((String) mapdata.get("UDAttach4__c"));

            Object UDAttach4__c = mapdata.get("UDAttach4__c");
            if (UDAttach4__c != null) {
                String s = String.valueOf(mapdata.get("UDAttach4__c"));
                entity.setUdAttach4C(s);
            } else {
                entity.setUdAttach4C(null);
            }
            //entity.setUdDate7C((Timestamp) mapdata.get("UDDate7__c"));
            Object UDDate7__c = mapdata.get("UDDate7__c");
            if (UDDate7__c != null) {
                Timestamp time = new Timestamp(new Double((double) UDDate7__c).longValue());
                entity.setUdDate7C(time);
            } else {
                entity.setUdDate7C(null);
            }
            entity.setUdStext3C((String) mapdata.get("UDSText3__c"));
            entity.setUdLookup2C((String) mapdata.get("UDLookUp2__c"));
            //entity.setUdDate3C((Timestamp) mapdata.get("UDDate3__c"));
            Object UDDate3__c = mapdata.get("UDDate3__c");
            if (UDDate3__c != null) {
                Timestamp time = new Timestamp(new Double((double) UDDate3__c).longValue());
                entity.setUdDate3C(time);
            } else {
                entity.setUdDate3C(null);
            }
            entity.setUdSsel8C((String) mapdata.get("UDSSel8__c"));
            entity.setUdSsel4C((String) mapdata.get("UDSSel4__c"));
            entity.setUdCssel1C((String) mapdata.get("UDCSSel1__c"));
            entity.setL1UdCssel1C((String) mapdata.get("L1_UDCSSel1__c"));
            entity.setField6175sC((String) mapdata.get("field_6175s__c"));
            entity.setTraceId((String) mapdata.get("field_42Bs7__c"));
            entity.setField7TcaSC((String) mapdata.get("field_7tcaS__c"));
            entity.setOwnerName((String) mapdata.get("field_1zwf0__c"));
            entity.setOwnerPhone((String) mapdata.get("field_0xnl6__c"));
            entity.setSex((String) mapdata.get("field_gH6Cf__c"));
            entity.setAge((String) mapdata.get("field_3ch38__c"));
            entity.setSocialId((String) mapdata.get("field_Aq2u6__c"));
            entity.setFamilySituation((String) mapdata.get("field_TLc92__c"));
            //entity.setLastModifiedTime((Timestamp) mapdata.get("last_modified_time"));
            Object last_modified_time = mapdata.get("last_modified_time");
            if (last_modified_time != null) {
                Timestamp time = new Timestamp(new Double((double) last_modified_time).longValue());
                entity.setLastModifiedTime(time);
            } else {
                entity.setLastModifiedTime(null);
            }
            //  entity.setCreateTime((Timestamp) mapdata.get("create_time"));
            Object create_time = mapdata.get("create_time");
            if (create_time != null) {
                Timestamp time = new Timestamp(new Double((double) create_time).longValue());
                entity.setCreateTime(time);
            } else {
                entity.setCreateTime(null);
            }
            //entity.setCreatedBy((String) mapdata.get("created_by"));
            Object created_by = mapdata.get("created_by");
            if (created_by != null) {
                String s = String.valueOf(mapdata.get("created_by"));
                entity.setCreatedBy(s);
            } else {
                entity.setCreatedBy(null);
            }

            //entity.setDataOwnDepartment((String) mapdata.get("data_own_department"));
            Object data_own_department = mapdata.get("data_own_department");
            if (data_own_department != null) {
                String s = String.valueOf(mapdata.get("data_own_department"));
                entity.setDataOwnDepartment(s);
            } else {
                entity.setDataOwnDepartment(null);
            }

            entity.setOutOwner((String) mapdata.get("out_owner"));
            //entity.setLastModifiedBy((String) mapdata.get("last_modified_by"));
            Object last_modified_by = mapdata.get("last_modified_by");
            if (last_modified_by != null) {
                String s = String.valueOf(mapdata.get("last_modified_by"));
                entity.setLastModifiedBy(s);
            } else {
                entity.setLastModifiedBy(null);
            }
            entity.setAccountStatus((String) mapdata.get("account_status"));
            //entity.setLastDealClosedTime((Timestamp) mapdata.get("last_deal_closed_time"));
            Object last_deal_closed_time = mapdata.get("last_deal_closed_time");
            if (last_deal_closed_time != null) {
                Timestamp time = new Timestamp(new Double((double) last_deal_closed_time).longValue());
                entity.setLastDealClosedTime(time);
            } else {
                entity.setLastDealClosedTime(null);
            }
            entity.setOwnerDepartment((String) mapdata.get("owner_department"));
            entity.setLockStatus((String) mapdata.get("lock_status"));
            // entity.setExpireTime((Timestamp) mapdata.get("expire_time"));
            Object expire_time = mapdata.get("expire_time");
            if (expire_time != null) {
                Timestamp time = new Timestamp(new Double((double) expire_time).longValue());
                entity.setExpireTime(time);
            } else {
                entity.setExpireTime(null);
            }
            entity.setCompletionRate((String) mapdata.get("completion_rate"));
            //entity.setLastFollowedTime((Timestamp) mapdata.get("last_followed_time"));
            Object last_followed_time = mapdata.get("last_followed_time");
            if (last_followed_time != null) {
                Timestamp time = new Timestamp(new Double((double) last_followed_time).longValue());
                entity.setLastFollowedTime(time);
            } else {
                entity.setLastFollowedTime(null);
            }
            entity.setRemainingTime((String) mapdata.get("remaining_time"));
            entity.setOutResources((String) mapdata.get("out_resources"));
            entity.setDealStatus((String) mapdata.get("deal_status"));
            // entity.setOwner((String) mapdata.get("ShopExcel"));
            Object owner = mapdata.get("ShopExcel");
            if (owner != null) {
                String s = String.valueOf(mapdata.get("ShopExcel"));
                entity.setOwner(s);
            } else {
                entity.setOwner(null);
            }
            entity.setRecycledReason((String) mapdata.get("recycled_reason"));
            // entity.setClaimedTime((Timestamp) mapdata.get("claimed_time"));
            Object claimed_time = mapdata.get("claimed_time");
            if (claimed_time != null) {
                Timestamp time = new Timestamp(new Double((double) claimed_time).longValue());
                entity.setClaimedTime(time);
            } else {
                entity.setClaimedTime(null);
            }
            entity.setTransferCount((String) mapdata.get("transfer_count"));
            entity.setRecordType((String) mapdata.get("record_type"));
            // entity.setReturnedTime((Timestamp) mapdata.get("returned_time"));
            Object returned_time = mapdata.get("returned_time");
            if (returned_time != null) {
                Timestamp time = new Timestamp(new Double((double) returned_time).longValue());
                entity.setReturnedTime(time);
            } else {
                entity.setReturnedTime(null);
            }
            entity.setBizStatus((String) mapdata.get("biz_status"));
            entity.setLifeStatus((String) mapdata.get("life_status"));
            entity.setLeadsId((String) mapdata.get("leads_id"));
            // entity.setOwnerModifiedTime((Timestamp) mapdata.get("owner_modified_time"));
            Object owner_modified_time = mapdata.get("owner_modified_time");
            if (owner_modified_time != null) {
                Timestamp time = new Timestamp(new Double((double) owner_modified_time).longValue());
                entity.setOwnerModifiedTime(time);
            } else {
                entity.setOwnerModifiedTime(null);
            }
            entity.setHighSeasName((String) mapdata.get("high_seas_name"));
            entity.setHighSeasId((String) mapdata.get("high_seas_id"));
            //entity.setLastFollower((String) mapdata.get("last_follower"));
            Object last_follower = mapdata.get("last_follower");
            if (last_follower != null) {
                String s = String.valueOf(mapdata.get("last_follower"));
                entity.setLastFollower(s);
            } else {
                entity.setLastFollower(null);
            }
            entity.setRecTimeStamp(time1);
            list.add(entity);
        }
        return list;
    }


    //TODO 微信接口  字段全
    public List<IntfWecat> getwecat(Integer offect, Integer limit) {
        Calendar c = Calendar.getInstance();
        c.set(Calendar.HOUR_OF_DAY, 0);
        c.set(Calendar.MINUTE, 0);
        c.set(Calendar.SECOND, 0);
        c.set(Calendar.MILLISECOND, 0);
        //获取当前时间的凌晨
        Long today = c.getTimeInMillis();
        //获取昨天时间的凌晨
        long yesterday = today - (24 * 60 * 60 * 1000);
        Map map = fenXiangInterface();
       /* String param = " {\n" +
                "    \"corpAccessToken\": \"" + map.get("corpAccessToken") + "\",\n" +
                "    \"corpId\": \"" + map.get("corpId") + "\",\n" +
                "    \"currentOpenUserId\": \"" + openUserId + "\",\n" +
                "    \"data\": {\n" +
                "        \"dataObjectApiName\": \"WechatFanObj\",\n" +
                "        \"search_query_info\": {\n" +
                "            \"limit\": " + limit + ",\n" +
                "            \"offset\": " + offect + ",\n" +
                "            \"filters\": [],\n" +
                "            \"orders\": [],\n" +
                "            \"fieldProjection\": []\n" +
                "        }\n" +
                "    }\n" +
                "  }";*/

        String param = "   {\n" +
                "    \"corpAccessToken\": \"" + map.get("corpAccessToken") + "\",\n" +
                "    \"corpId\": \"" + map.get("corpId") + "\",\n" +
                "    \"currentOpenUserId\": \"" + openUserId + "\",\n" +
                "    \"data\": {\n" +
                "        \"dataObjectApiName\": \"WechatFanObj\",\n" +
                "        \"search_query_info\": {\n" +
                "            \"limit\": "+limit+",\n" +
                "            \"offset\": "+offect+",\n" +
                "            \"filters\": [\n" +
                "                {\n" +
                "                    \"field_name\": \"create_time\",\n" +
                "                    \"field_values\": [\n" +
                "                        \"" + yesterday + "\"\n" +
                "                    ],\n" +
                "                    \"operator\": \"GTE\"\n" +
                "                },\n" +
                "                 {\n" +
                "                    \"field_name\": \"create_time\",\n" +
                "                    \"field_values\": [\n" +
                "                        \"" + today + "\"\n" +
                "                    ],\n" +
                "                    \"operator\": \"LT\"\n" +
                "                }\n" +
                "            ]\n" +
                "        }\n" +
                "    }\n" +
                "  }";
        Map mp7 = httpClientUtil.sendPostForJson("", param, urlTest2);

        //定义实体类集合
        List<IntfWecat> list = new ArrayList<IntfWecat>();

        //获取当前时间(实体类会赋值)
        Date date = new Date();
        DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String time1 = df.format(date);

        //获取最终数据
        Map<String, Object> data = (Map<String, Object>) mp7.get("data");
        ArrayList<Object> dataList = (ArrayList<Object>) data.get("dataList");

        for (Object o : dataList) {
            Map<String, Object> mapdata = (Map<String, Object>) o;
            IntfWecat entity = new IntfWecat();
            entity.setName((String) mapdata.get("name"));
            entity.setAttentionStatus((String) mapdata.get("attention_status"));
            entity.setClueId((String) mapdata.get("clue_id"));
            entity.setQrChannel((String) mapdata.get("qr_channel"));
            entity.setOwnerDepartment((String) mapdata.get("owner_department"));
            entity.setAppId((String) mapdata.get("app_id"));
            entity.setArea((String) mapdata.get("area"));
            entity.setArea((String) mapdata.get("location "));

            entity.setWxAppId((String) mapdata.get("wx_app_id"));
            entity.setWxOpenId((String) mapdata.get("wx_open_id"));
            entity.setPhone((String) mapdata.get("phone"));
            // entity.setAttentionSource((String) mapdata.get("attention_source"));
            Object attention_source = mapdata.get("attention_source");
            if (attention_source != null) {
                String s = String.valueOf(mapdata.get("attention_source"));
                entity.setAttentionSource(s);
            } else {
                entity.setAttentionSource(null);
            }
            // entity.setCreateTime((String) mapdata.get("create_time"));
            Object create_time = mapdata.get("create_time");
            if (create_time != null) {
                Timestamp time = new Timestamp(new Double((double) create_time).longValue());
                entity.setCreateTime(time);
            } else {
                entity.setCreateTime(null);
            }
            //entity.setCreatedBy((String) mapdata.get("created_by"));
            Object created_by = mapdata.get("created_by");
            if (created_by != null) {
                String s = String.valueOf(mapdata.get("created_by"));
                entity.setCreatedBy(s);
            } else {
                entity.setCreatedBy(null);
            }
            // entity.setDataOwnDepartment((String) mapdata.get("data_own_department"));
            Object data_own_department = mapdata.get("data_own_department");
            if (data_own_department != null) {
                String s = String.valueOf(mapdata.get("data_own_department"));
                entity.setDataOwnDepartment(s);
            } else {
                entity.setDataOwnDepartment(null);
            }
            entity.setAttentionResources((String) mapdata.get("attention_resources"));
            entity.setOutOwner((String) mapdata.get("out_owner"));
            //entity.setLastModifiedTime((String) mapdata.get("last_modified_time"));
            Object last_modified_time = mapdata.get("last_modified_time");
            if (last_modified_time != null) {
                Timestamp time = new Timestamp(new Double((double) last_modified_time).longValue());
                entity.setLastModifiedTime(time);
            } else {
                entity.setLastModifiedTime(null);
            }
            // entity.setLastModifiedBy((String) mapdata.get("last_modified_by"));

            Object last_modified_by = mapdata.get("last_modified_by");
            if (last_modified_by != null) {
                String s = String.valueOf(mapdata.get("last_modified_by"));
                entity.setLastModifiedBy(s);
            } else {
                entity.setLastModifiedBy(null);
            }
            // entity.setAttentionTime((String) mapdata.get("attention_time"));

            Object attention_time = mapdata.get("attention_time");
            if (attention_time != null) {
                Timestamp time = new Timestamp(new Double((double) attention_time).longValue());
                entity.setAttentionTime(time);
            } else {
                entity.setAttentionTime(null);
            }

            entity.setRemark((String) mapdata.get("remark"));
            entity.setContactId((String) mapdata.get("contact_id"));
            entity.setAppStatus((String) mapdata.get("app_status"));
            entity.setServiceCommissioner((String) mapdata.get("service_commissioner"));
            // entity.setOwner((String) mapdata.get("ShopExcel"));
            Object owner = mapdata.get("ShopExcel");
            if (owner != null) {
                String s = String.valueOf(mapdata.get("ShopExcel"));
                entity.setOwner(s);
            } else {
                entity.setOwner(null);
            }
            //entity.setWxHeadImage((String) mapdata.get("wx_head_image"));
            Object wx_head_image = mapdata.get("wx_head_image");
            if (wx_head_image != null) {
                String s = String.valueOf(mapdata.get("wx_head_image"));
                entity.setWxHeadImage(s);
            } else {
                entity.setWxHeadImage(null);
            }
            entity.setLifeStatus((String) mapdata.get("life_status"));
            entity.setSex((String) mapdata.get("sex"));
            entity.setRecordType((String) mapdata.get("record_type"));
            entity.setAppName((String) mapdata.get("app_name"));
            entity.setAccountId((String) mapdata.get("account_id"));
            entity.setUsername((String) mapdata.get("username"));
            entity.setMarketingEventId((String) mapdata.get("marketing_event_id"));
            entity.setMarketingActivityId((String) mapdata.get("marketing_activity_id"));
            entity.setSpreadFsUserId((String) mapdata.get("spread_fs_user_id"));
            entity.setCountry((String) mapdata.get("country"));
            entity.setCity((String) mapdata.get("city"));
            entity.setLockRule((String) mapdata.get("lock_rule"));
            entity.setOutTenantId((String) mapdata.get("out_tenant_id"));
            entity.setAddress((String) mapdata.get("address"));
            entity.setRecTimeStamp(time1);
            list.add(entity);
        }


        return list;
    }


    //TODO 设计师档案接口 自定义对象
    public  List<IntfStylist> getStylist(Integer offect, Integer limit) {
        Map map = fenXiangInterface();
        String param = " {\n" +
                "    \"corpAccessToken\": \"" + map.get("corpAccessToken") + "\",\n" +
                "    \"corpId\": \"" + map.get("corpId") + "\",\n" +
                "    \"currentOpenUserId\": \"" + openUserId + "\",\n" +
                "    \"data\": {\n" +
                "        \"dataObjectApiName\": \"object_designer__c\",\n" +
                "        \"search_query_info\": {\n" +
                "            \"limit\": " + limit + ",\n" +
                "            \"offset\": " + offect + ",\n" +
                "            \"filters\": [],\n" +
                "        }\n" +
                "    }\n" +
                "  }";
        Map mp8 = httpClientUtil.sendPostForJson("", param, urlTest3);

        //定义实体类集合
        List<IntfStylist> list = new ArrayList<IntfStylist>();

        //获取当前时间(实体类会赋值)
        Date date = new Date();
        DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String time1 = df.format(date);

        //获取最终数据
        Map<String, Object> data = (Map<String, Object>) mp8.get("data");
        ArrayList<Object> dataList = (ArrayList<Object>) data.get("dataList");

        for (Object o : dataList) {
            Map<String, Object> mapdata = (Map<String, Object>) o;
            IntfStylist entity = new IntfStylist();
            entity.setName((String) mapdata.get("name"));
            entity.setPhone((String) mapdata.get("field_designertell__c"));
            entity.setWechatName((String) mapdata.get("field_xkUEb__c"));
            entity.setCity((String) mapdata.get("field_p484S__c"));
            entity.setFieldB1bgdC((String) mapdata.get("field_B1bgd__c"));
            entity.setRemake((String) mapdata.get("field_kO1Od__c"));
            entity.setGraduationSchool((String) mapdata.get("field_M2Z4n__c"));
            entity.setWorkRoom((String) mapdata.get("field_vLuI8__c"));
            entity.setPosition((String) mapdata.get("field_4k1aV__c"));
            entity.setSex((String) mapdata.get("field_f2f0d__c"));
            //entity.setBirthday((Timestamp) mapdata.get("field_0ism9__c"));

            Object field_0ism9__c = mapdata.get("field_0ism9__c");
            if (field_0ism9__c != null) {
                Timestamp time = new Timestamp(new Double((double) field_0ism9__c).longValue());
                entity.setBirthday(time);
            } else {
                entity.setBirthday(null);
            }
            entity.setFieldBs1mdC((String) mapdata.get("field_bs1mD__c"));
            entity.setFieldFqg01C((String) mapdata.get("field_fQG01__c"));
            //entity.setFieldXto25C((String) mapdata.get("field_xto25__c"));
            Object field_xto25__c = mapdata.get("field_xto25__c");
            if (field_xto25__c != null) {
                String s = String.valueOf(mapdata.get("field_xto25__c"));
                entity.setFieldXto25C(s);
            } else {
                entity.setFieldXto25C(null);
            }
            entity.setFieldC4rasC((String) mapdata.get("field_c4rAs__c"));
            entity.setFieldA1dsnC((String) mapdata.get("field_a1Dsn__c"));
            //entity.setFieldBrhz4C((Double) mapdata.get("field_brhZ4__c"));
            Object field_brhZ4__c = mapdata.get("field_brhZ4__c");
            if (field_brhZ4__c != null) {
                entity.setFieldBrhz4C(Double.parseDouble((String) field_brhZ4__c));
            } else {
                entity.setFieldBrhz4C(Double.valueOf(0));
            }
            //entity.setField2Ubm2C((Double) mapdata.get("field_2UBm2__c"));
            Object field_2UBm2__c = mapdata.get("field_2UBm2__c");
            if (field_2UBm2__c != null) {
                entity.setField2ubm2C(Double.parseDouble((String) field_2UBm2__c));
            } else {
                entity.setField2ubm2C(Double.valueOf(0));
            }
            entity.setField552myC((String) mapdata.get("field_552My__c"));
            // entity.setField04Ce4C((Double) mapdata.get("field_04CE4__c"));
            Object field_04CE4__c = mapdata.get("field_04CE4__c");
            if (field_04CE4__c != null) {
                entity.setField04ce4C(Double.parseDouble((String) field_04CE4__c));
            } else {
                entity.setField04ce4C(Double.valueOf(0));
            }
            entity.setField2i5ouC((String) mapdata.get("field_2i5ou__c"));
            entity.setField06gt0C((String) mapdata.get("field_06gT0__c"));
            entity.setField23986C((String) mapdata.get("field_23986__c"));
            //entity.setAge((Long) mapdata.get("field_PDm72__c"));
            Object field_pDm72__c = mapdata.get("field_PDm72__c");
            if (field_pDm72__c != null) {
                entity.setAge((Integer) field_pDm72__c);
            } else {
                entity.setAge(null);
            }
            entity.setAdress((String) mapdata.get("field_edzs2__c"));
            entity.setFieldP2PogC((String) mapdata.get("field_p2pog__c"));
            entity.setField0RipdC((String) mapdata.get("field_0rIpd__c"));
            entity.setFieldVq4khC((String) mapdata.get("field_Vq4kh__c"));
            entity.setFieldXsjenC((String) mapdata.get("field_XSjeN__c"));
            entity.setFieldQut13C((String) mapdata.get("field_QUt13__c"));
            entity.setField52cpgC((String) mapdata.get("field_52cpG__c"));
            // entity.setFieldWs4H2C((Timestamp) mapdata.get("field_ws4h2__c"));
            Object field_ws4h2__c = mapdata.get("field_ws4h2__c");
            if (field_ws4h2__c != null) {
                Timestamp time = new Timestamp(new Double((double) field_ws4h2__c).longValue());
                entity.setFieldWs4h2C(time);
            } else {
                entity.setFieldWs4h2C(null);
            }
            entity.setFieldLju6kC((String) mapdata.get("field_lJu6K__c"));
            entity.setFieldXoykzC((String) mapdata.get("field_xoyKz__c"));
            entity.setFieldM2px3C((String) mapdata.get("field_M2px3__c"));
            entity.setFieldZw44qC((String) mapdata.get("field_zW44q__c"));
            entity.setFieldVlui8C((String) mapdata.get("field_vLuI8__c"));
            entity.setField0U4dnC((String) mapdata.get("field_0U4Dn__c"));
            entity.setField9auh3C((String) mapdata.get("field_9Auh3__c"));
            entity.setFieldKh1ocC((String) mapdata.get("field_kh1oc__c"));
            entity.setField1zqgcC((String) mapdata.get("field_1zQGc__c"));
            entity.setField7mpk2C((String) mapdata.get("field_7MPk2__c"));
            entity.setField5vy14C((String) mapdata.get("field_5vY14__c"));
            entity.setFieldK1uuuC((String) mapdata.get("field_k1xuu__c"));
            entity.setFieldSw54bC((String) mapdata.get("field_sw54b__c"));
            entity.setFieldLfd2yC((String) mapdata.get("field_Lfd2y__c"));
            entity.setFieldP85xmC((String) mapdata.get("field_P85xM__c"));
            entity.setField8dhvkC((String) mapdata.get("field_8dhvK__c"));
            entity.setFieldGkb0IC((String) mapdata.get("field_gkB0I__c"));
            entity.setFieldNzrh9C((String) mapdata.get("field_nzRH9__c"));
            entity.setFieldNnnfxC((String) mapdata.get("field_NnnFX__c"));
            //entity.setFieldZlkznC((String) mapdata.get("field_zLkzn__c"));
            Object field_zLkzn__c = mapdata.get("field_zLkzn__c");
            if (field_zLkzn__c != null) {
                String s = String.valueOf(mapdata.get("field_zLkzn__c"));
                entity.setFieldZlkznC(s);
            } else {
                entity.setFieldZlkznC(null);
            }

            entity.setFieldJxbc0C((String) mapdata.get("field_jxBc0__c"));
            entity.setFieldYj1bmC((String) mapdata.get("field_YJ1bM__c"));
            // entity.setField7S5C7C((String) mapdata.get("field_7s5c7__c"));
            Object field_7s5c7__c = mapdata.get("field_7s5c7__c");
            if (field_7s5c7__c != null) {
                String s = String.valueOf(mapdata.get("field_7s5c7__c"));
                entity.setField7s5c7C(s);
            } else {
                entity.setField7s5c7C(null);
            }
            entity.setField1v93hC((String) mapdata.get("field_1V93H__c"));
            entity.setField26ia2C((String) mapdata.get("field_26ia2__c"));
            entity.setFieldGtf41C((String) mapdata.get("field_gTf41__c"));
            entity.setFieldP2y00C((String) mapdata.get("field_P2Y00__c"));
            // entity.setFieldCwmkxC((Timestamp) mapdata.get("field_cwmkx__c"));
            Object field_cwmkx__c = mapdata.get("field_cwmkx__c");
            if (field_cwmkx__c != null) {
                Timestamp time = new Timestamp(new Double((double) field_cwmkx__c).longValue());
                entity.setFieldCwmkxC(time);
            } else {
                entity.setFieldCwmkxC(null);
            }
            entity.setField24guuC((String) mapdata.get("field_24gUu__c"));
            //entity.setFieldRzge2C((Timestamp) mapdata.get("field_rzge2__c"));
            Object field_rzge2__c = mapdata.get("field_rzge2__c");
            if (field_rzge2__c != null) {
                Timestamp time = new Timestamp(new Double((double) field_rzge2__c).longValue());
                entity.setFieldRzge2C(time);
            } else {
                entity.setFieldRzge2C(null);
            }
            entity.setFieldS2kssC((String) mapdata.get("field_s2kSs__c"));
            // entity.setFieldC25QcC((Timestamp) mapdata.get("field_C25qC__c"));
            Object field_C25qC__c = mapdata.get("field_C25qC__c");
            if (field_C25qC__c != null) {
                Timestamp time = new Timestamp(new Double((double) field_C25qC__c).longValue());
                entity.setFieldC25qcC(time);
            } else {
                entity.setFieldC25qcC(null);
            }
            entity.setFieldL1h8kC((String) mapdata.get("field_L1h8k__c"));
            // entity.setFieldLneewC((Timestamp) mapdata.get("field_lNEew__c"));
            Object field_lNEew__c = mapdata.get("field_lNEew__c");
            if (field_lNEew__c != null) {
                Timestamp time = new Timestamp(new Double((double) field_lNEew__c).longValue());
                entity.setFieldLneewC(time);
            } else {
                entity.setFieldLneewC(null);
            }
            entity.setFieldYpi1mC((String) mapdata.get("field_Ypi1M__c"));
            //entity.setField5149PC((Timestamp) mapdata.get("field_5149P__c"));
            Object field_5149P__c = mapdata.get("field_5149P__c");
            if (field_5149P__c != null) {
                Timestamp time = new Timestamp(new Double((double) field_5149P__c).longValue());
                entity.setField5149pC(time);
            } else {
                entity.setField5149pC(null);
            }
            entity.setFieldO7eyjC((String) mapdata.get("field_o7eYJ__c"));
            //entity.setFieldR2Xj0C((Timestamp) mapdata.get("field_r2xj0__c"));
            Object field_r2xj0__c = mapdata.get("field_r2xj0__c");
            if (field_r2xj0__c != null) {
                Timestamp time = new Timestamp(new Double((double) field_r2xj0__c).longValue());
                entity.setFieldR2xj0C(time);
            } else {
                entity.setFieldR2xj0C(null);
            }
            entity.setField8k41iC((String) mapdata.get("field_8k41i__c"));
            // entity.setFieldBb04PC((Timestamp) mapdata.get("field_bB04p__c"));
            Object field_bB04p__c = mapdata.get("field_bB04p__c");
            if (field_bB04p__c != null) {
                Timestamp time = new Timestamp(new Double((double) field_bB04p__c).longValue());
                entity.setFieldBb04PC(time);
            } else {
                entity.setFieldBb04PC(null);
            }
            entity.setFieldKfdd2C((String) mapdata.get("field_KFdd2__c"));
            // entity.setFieldP2YhlC((Timestamp) mapdata.get("field_p2yhL__c"));
            Object field_p2yhL__c = mapdata.get("field_p2yhL__c");
            if (field_p2yhL__c != null) {
                Timestamp time = new Timestamp(new Double((double) field_p2yhL__c).longValue());
                entity.setFieldP2yhlC(time);
            } else {
                entity.setFieldP2yhlC(null);
            }
            entity.setFieldCfislC((String) mapdata.get("field_cfIsl__c"));
            entity.setFieldS1yt9C((String) mapdata.get("field_s1yt9__c"));
            entity.setFieldEi6zzC((String) mapdata.get("field_ei6zz__c"));
            entity.setField3v620C((String) mapdata.get("field_3v620__c"));
            //entity.setField4T18BC((String) mapdata.get("field_4T18b__c"));
            Object field_4T18b__c = mapdata.get("field_4T18b__c");
            if (field_4T18b__c != null) {
                String s = String.valueOf(mapdata.get("field_4T18b__c"));
                entity.setField4t18bC(s);
            } else {
                entity.setField4t18bC(null);
            }
            // entity.setFieldFph5NC((String) mapdata.get("field_fPh5n__c"));
            Object field_fPh5n__c = mapdata.get("field_fPh5n__c");
            if (field_fPh5n__c != null) {
                String s = String.valueOf(mapdata.get("field_fPh5n__c"));
                entity.setFieldFph5nC(s);
            } else {
                entity.setFieldFph5nC(null);
            }
            entity.setLifeStatus((String) mapdata.get("life_status"));
            entity.setLockStatus((String) mapdata.get("lock_status"));
            // entity.setOwner((String) mapdata.get("ShopExcel"));
            Object owner = mapdata.get("ShopExcel");
            if (owner != null) {
                String s = String.valueOf(mapdata.get("ShopExcel"));
                entity.setOwner(s);
            } else {
                entity.setOwner(null);
            }
            entity.setOwnerDepartment((String) mapdata.get("owner_department"));
            entity.setRecordType((String) mapdata.get("record_type"));
            //entity.setLastModifiedTime((Timestamp) mapdata.get("last_modified_time"));
            Object last_modified_time = mapdata.get("last_modified_time");
            if (last_modified_time != null) {
                Timestamp time = new Timestamp(new Double((double) last_modified_time).longValue());
                entity.setLastModifiedTime(time);
            } else {
                entity.setLastModifiedTime(null);
            }
            // entity.setCreateTime((Timestamp) mapdata.get("create_time"));
            Object create_time = mapdata.get("create_time");
            if (create_time != null) {
                Timestamp time = new Timestamp(new Double((double) create_time).longValue());
                entity.setCreateTime(time);
            } else {
                entity.setCreateTime(null);
            }
            // entity.setCreatedBy((String) mapdata.get("created_by"));
            Object created_by = mapdata.get("created_by");
            if (created_by != null) {
                String s = String.valueOf(mapdata.get("created_by"));
                entity.setCreatedBy(s);
            } else {
                entity.setCreatedBy(null);
            }
            //entity.setDataOwnDepartment((String) mapdata.get("data_own_department"));
            Object data_own_department = mapdata.get("data_own_department");
            if (data_own_department != null) {
                String s = String.valueOf(mapdata.get("data_own_department"));
                entity.setDataOwnDepartment(s);
            } else {
                entity.setDataOwnDepartment(null);
            }
            //entity.setOutOwner((String) mapdata.get("out_owner"));

            Object out_owner = mapdata.get("out_owner");
            if (out_owner != null) {
                String s = String.valueOf(mapdata.get("out_owner"));
                entity.setOutOwner(s);
            } else {
                entity.setOutOwner(null);
            }
            //entity.setLastModifiedBy((String) mapdata.get("last_modified_by"));
            Object last_modified_by = mapdata.get("last_modified_by");
            if (last_modified_by != null) {
                String s = String.valueOf(mapdata.get("last_modified_by"));
                entity.setLastModifiedBy(s);
            } else {
                entity.setLastModifiedBy(null);
            }
            entity.setCountry((String) mapdata.get("field_fak2b__c"));
            entity.setRegion((String) mapdata.get("field_5qKFB__c"));
            entity.setProvince((String) mapdata.get("field_my802__c"));
            entity.setCityCode((String) mapdata.get("field_t4bak__c"));
            entity.setRecTimeStamp(time1);
            list.add(entity);

        }
        return list;
    }


    //TODO 业绩-集团下单接口
    public List<IntfCompanyOrder> getCompanyOrder(Integer offect, Integer limit) {
        Map map = fenXiangInterface();
        /*String param = " {\n" +
                "    \"corpAccessToken\": \"" + map.get("corpAccessToken") + "\",\n" +
                "    \"corpId\": \"" + map.get("corpId") + "\",\n" +
                "    \"currentOpenUserId\": \"" + openUserId + "\",\n" +
                "    \"data\": {\n" +
                "        \"dataObjectApiName\": \"object_aG1ym__c\",\n" +
                "        \"search_query_info\": {\n" +
                "            \"limit\": " + limit + ",\n" +
                "            \"offset\": " + offect + ",\n" +
                "            \"filters\": [],\n" +
                "        }\n" +
                "    }\n" +
                "  }";*/

        String param = "{\n" +
                "    \"corpAccessToken\": \"" + map.get("corpAccessToken") + "\",\n" +
                "    \"corpId\": \"" + map.get("corpId") + "\",\n" +
                "    \"currentOpenUserId\": \"" + openUserId + "\",\n" +
                "    \"data\": {\n" +
                "    \"search_query_info\": {\n" +
                "      \"offset\": " + offect + ",\n" +
                "      \"limit\": " + limit + ",\n" +
                "      \"filters\": [\n" +
                "           {\n" +
                "                    \"field_name\": \"create_time\",\n" +
                "                    \"field_values\": [\n" +
                "                        \"1598889600000\"\n" +
                "                    ],\n" +
                "                    \"operator\": \"GT\"\n" +
                "                }\n" +
                "      ]\n" +
                "    },\n" +
                "    \"dataObjectApiName\": \"object_aG1ym__c\"\n" +
                "  }\n" +
                "  }";
        Map mp9 = httpClientUtil.sendPostForJson("", param, urlTest3);

        //定义实体类集合
        List<IntfCompanyOrder> list = new ArrayList<IntfCompanyOrder>();

        //获取当前时间(实体类会赋值)
        Date date = new Date();
        DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String time1 = df.format(date);

        //获取最终数据
        Map<String, Object> data = (Map<String, Object>) mp9.get("data");
        ArrayList<Object> dataList = (ArrayList<Object>) data.get("dataList");

        for (Object o : dataList) {
            Map<String, Object> mapdata = (Map<String, Object>) o;
            IntfCompanyOrder entity = new IntfCompanyOrder();

            entity.setField9sjsiC((String) mapdata.get("field_9SJSl__c"));
            entity.setName((String) mapdata.get("name"));
            //entity.setFieldIS7j7C((String) mapdata.get("field_iS7j7__c"));
            Object field_iS7j7__c = mapdata.get("field_iS7j7__c");
            if (field_iS7j7__c != null) {
                entity.setFieldIS7j7C(Double.parseDouble((String) field_iS7j7__c));
            } else {
                entity.setFieldIS7j7C(Double.valueOf(0));
            }
            entity.setReceivableAmount((Timestamp) mapdata.get(""));
            // entity.setOrderAmount((Double) mapdata.get("field_3i1sX__c"));
            Object field_3i1sX__c = mapdata.get("field_3i1sX__c");
            if (field_3i1sX__c != null) {
                entity.setOrderAmount(Double.parseDouble((String) field_3i1sX__c));
            } else {
                entity.setOrderAmount(Double.valueOf(0));
            }
            //entity.setCreateTime((Timestamp) mapdata.get("create_time"));
            Object create_time = mapdata.get("create_time");
            if (create_time != null) {
                Timestamp time = new Timestamp(new Double((double) create_time).longValue());
                entity.setCreateTime(time);
            } else {
                entity.setCreateTime(null);
            }
            // entity.setCreatedBy((String) mapdata.get("created_by"));
            Object created_by = mapdata.get("created_by");
            if (created_by != null) {
                String s = String.valueOf(mapdata.get("created_by"));
                entity.setCreatedBy(s);
            } else {
                entity.setCreatedBy(null);
            }
            //entity.setLastModifiedTime((Timestamp) mapdata.get("last_modified_time"));
            Object last_modified_time = mapdata.get("last_modified_time");
            if (last_modified_time != null) {
                Timestamp time = new Timestamp(new Double((double) last_modified_time).longValue());
                entity.setLastModifiedTime(time);
            } else {
                entity.setLastModifiedTime(null);
            }
            // entity.setLastModifiedBy((String) mapdata.get("last_modified_by"));
            Object last_modified_by = mapdata.get("last_modified_by");
            if (last_modified_by != null) {
                String s = String.valueOf(mapdata.get("last_modified_by"));
                entity.setLastModifiedBy(s);
            } else {
                entity.setLastModifiedBy(null);
            }
            entity.setOwnerDepartment((String) mapdata.get("owner_department"));
            // entity.setOwner((String) mapdata.get("ShopExcel"));
            Object owner = mapdata.get("ShopExcel");
            if (owner != null) {
                String s = String.valueOf(mapdata.get("ShopExcel"));
                entity.setOwner(s);
            } else {
                entity.setOwner(null);
            }
            entity.setRecordType((String) mapdata.get("record_type"));
            entity.setLifeStatus((String) mapdata.get("life_status"));
            entity.setRecTimeStamp(time1);
            list.add(entity);
        }
        return list;
    }


    //TODO 服务项目
    public List<IntfServiceProject> getServiceCompany(Integer offect, Integer limit) {
        Map map = fenXiangInterface();
        String param = " {\n" +
                "    \"corpAccessToken\": \"" + map.get("corpAccessToken") + "\",\n" +
                "    \"corpId\": \"" + map.get("corpId") + "\",\n" +
                "    \"currentOpenUserId\": \"" + openUserId + "\",\n" +
                "    \"data\": {\n" +
                "        \"dataObjectApiName\": \"object_gQcec__c\",\n" +
                "        \"search_query_info\": {\n" +
                "            \"limit\": " + limit + ",\n" +
                "            \"offset\": " + offect + ",\n" +
                "            \"filters\": [],\n" +
                "        }\n" +
                "    }\n" +
                "  }";
        Map mp10 = httpClientUtil.sendPostForJson("", param, urlTest3);

        //定义实体类集合
        List<IntfServiceProject> list = new ArrayList<IntfServiceProject>();

        //获取当前时间(实体类会赋值)
        Date date = new Date();
        DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String time1 = df.format(date);

        //获取最终数据
        Map<String, Object> data = (Map<String, Object>) mp10.get("data");
        ArrayList<Object> dataList = (ArrayList<Object>) data.get("dataList");

        for (Object o : dataList) {
            Map<String, Object> mapdata = (Map<String, Object>) o;
            IntfServiceProject entity = new IntfServiceProject();
            entity.setFieldAosd5C((String) mapdata.get("field_aoSd5__c"));
            entity.setField2CfznC((String) mapdata.get("field_2cfZN__c"));
            // entity.setFieldD3XhcC((String) mapdata.get("field_d3Xhc__c"));
            Object field_d3Xhc__c = mapdata.get("field_d3Xhc__c");
            if (field_d3Xhc__c != null) {
                String s = String.valueOf(mapdata.get("field_d3Xhc__c"));
                entity.setFieldD3XhcC(s);
            } else {
                entity.setFieldD3XhcC(null);
            }
            //entity.setFieldF13J2C((String) mapdata.get("field_F13j2__c"));
            Object field_F13j2__c = mapdata.get("field_F13j2__c");
            if (field_F13j2__c != null) {
                String s = String.valueOf(mapdata.get("field_F13j2__c"));
                entity.setFieldF13J2C(s);
            } else {
                entity.setFieldF13J2C(null);
            }
            //entity.setFieldXuaolC((Timestamp) mapdata.get("field_xUaol__c"));
            Object field_xUaol__c = mapdata.get("field_xUaol__c");
            if (field_xUaol__c != null) {
                Timestamp time = new Timestamp(new Double((double) field_xUaol__c).longValue());
                entity.setFieldXuaolC(time);
            } else {
                entity.setFieldXuaolC(null);
            }
            entity.setFieldBtdcbC((String) mapdata.get(" field_btdCb__c"));
            entity.setFieldUh2UbC((String) mapdata.get("field_Uh2uB__c"));
            // entity.setFieldPg745C((Timestamp) mapdata.get("field_pg745__c"));
            Object field_pg745__c = mapdata.get("field_pg745__c");
            if (field_pg745__c != null) {
                Timestamp time = new Timestamp(new Double((double) field_pg745__c).longValue());
                entity.setFieldPg745C(time);
            } else {
                entity.setFieldPg745C(null);
            }
            entity.setFieldJo72WC((String) mapdata.get("field_JO72W__c"));
            entity.setFieldSdugmC((String) mapdata.get("field_sdugm__c"));
            // entity.setFieldTlynwC((String) mapdata.get("field_tlynW__c"));
            Object field_tlynW__c = mapdata.get("field_tlynW__c");
            if (field_tlynW__c != null) {
                String s = String.valueOf(mapdata.get("field_tlynW__c"));
                entity.setFieldTlynwC(s);
            } else {
                entity.setFieldTlynwC(null);
            }
            entity.setFieldT5Ir1C((String) mapdata.get("field_T5ir1__c"));
            //entity.setField2U863C((Timestamp) mapdata.get("field_2u863__c"));
            Object field_2u863__c = mapdata.get("field_2u863__c");
            if (field_2u863__c != null) {
                Timestamp time = new Timestamp(new Double((double) field_2u863__c).longValue());
                entity.setField2U863C(time);
            } else {
                entity.setField2U863C(null);
            }
            //entity.setField6RsilC((Timestamp) mapdata.get("field_6RSIL__c"));
            Object field_6RSIL__c = mapdata.get("field_6RSIL__c");
            if (field_6RSIL__c != null) {
                Timestamp time = new Timestamp(new Double((double) field_6RSIL__c).longValue());
                entity.setField6RsilC(time);
            } else {
                entity.setField6RsilC(null);
            }
            entity.setFieldRyyw1C((String) mapdata.get("field_RYYw1__c"));
            entity.setField7Bf2RC((String) mapdata.get("field_7Bf2r__c"));
            //entity.setCreatedBy((String) mapdata.get("created_by"));
            Object created_by = mapdata.get("created_by");
            if (created_by != null) {
                String s = String.valueOf(mapdata.get("created_by"));
                entity.setCreatedBy(s);
            } else {
                entity.setCreatedBy(null);
            }
            //entity.setCreateTime((Timestamp) mapdata.get("create_time"));
            Object create_time = mapdata.get("create_time");
            if (create_time != null) {
                Timestamp time = new Timestamp(new Double((double) create_time).longValue());
                entity.setCreateTime(time);
            } else {
                entity.setCreateTime(null);
            }
            entity.setFieldJ215DC((String) mapdata.get("field_J215d__c"));
            entity.setField1E8WuC((String) mapdata.get("field_1e8wU__c"));
            //entity.setOwner((String) mapdata.get("ShopExcel"));
            Object owner = mapdata.get("ShopExcel");
            if (owner != null) {
                String s = String.valueOf(mapdata.get("ShopExcel"));
                entity.setOwner(s);
            } else {
                entity.setOwner(null);
            }
            entity.setOwnerDepartment((String) mapdata.get("owner_department"));
            entity.setFieldK9OzcC((String) mapdata.get("field_k9oZc__c"));
            //entity.setDataOwnDepartment((String) mapdata.get("data_own_department"));
            Object data_own_department = mapdata.get("data_own_department");
            if (data_own_department != null) {
                String s = String.valueOf(mapdata.get("data_own_department"));
                entity.setDataOwnDepartment(s);
            } else {
                entity.setDataOwnDepartment(null);
            }
            entity.setField5NmdzC((String) mapdata.get("field_5nmdz__c  "));
            entity.setFieldV8I1FC((String) mapdata.get("field_V8I1f__c"));
            entity.setFieldQkm4RC((String) mapdata.get("field_qkM4r__c"));
            // entity.setField2An2YC((Double) mapdata.get("field_2an2y__c"));
            Object field_2an2y__c = mapdata.get("field_2an2y__c");
            if (field_2an2y__c != null) {
                entity.setField2An2YC(Double.parseDouble((String) field_2an2y__c));
            } else {
                entity.setField2An2YC(Double.valueOf(0));
            }
            entity.setFieldDy5EtC((String) mapdata.get("field_Dy5et__c"));
            // entity.setField1Jcs6C((Timestamp) mapdata.get("field_1JCS6__c"));
            Object field_1JCS6__c = mapdata.get("field_1JCS6__c");
            if (field_1JCS6__c != null) {
                Timestamp time = new Timestamp(new Double((double) field_1JCS6__c).longValue());
                entity.setField1Jcs6C(time);
            } else {
                entity.setField1Jcs6C(null);
            }
            // entity.setFieldPdaguC((String) mapdata.get("field_pDaGu__c"));
            Object field_pDaGu__c = mapdata.get("field_pDaGu__c");
            if (field_pDaGu__c != null) {
                String s = String.valueOf(mapdata.get("field_pDaGu__c"));
                entity.setFieldPdaguC(s);
            } else {
                entity.setFieldPdaguC(null);
            }
            entity.setFieldW8EgyC((String) mapdata.get("field_w8egY__c"));
            entity.setFieldJgrd4C((String) mapdata.get("field_jGrD4__c"));
            entity.setField1NjlgC((String) mapdata.get("field_1NjLg__c"));
            // entity.setFieldH4ThaC((String) mapdata.get("field_h4tha__c"));
            Object field_h4tha__c = mapdata.get("field_h4tha__c");
            if (field_h4tha__c != null) {
                String s = String.valueOf(mapdata.get("field_h4tha__c"));
                entity.setFieldH4ThaC(s);
            } else {
                entity.setFieldH4ThaC(null);
            }
            entity.setFieldIr221C((String) mapdata.get("field_ir221__c"));
            entity.setLifeStatus((String) mapdata.get("life_status"));
            // entity.setFieldWx74XC((Timestamp) mapdata.get("field_WX74x__c"));
            Object field_WX74x__c = mapdata.get("field_WX74x__c");
            if (field_WX74x__c != null) {
                Timestamp time = new Timestamp(new Double((double) field_WX74x__c).longValue());
                entity.setFieldWx74XC(time);
            } else {
                entity.setFieldWx74XC(null);
            }
            entity.setFieldUvlucC((String) mapdata.get("field_uVLUc__c"));
            entity.setField4Si3WC((String) mapdata.get("field_4Si3w__c"));
            //entity.setFieldI2FqnC((String) mapdata.get("field_i2fQn__c"));
            Object field_i2fQn__c = mapdata.get("field_i2fQn__c");
            if (field_i2fQn__c != null) {
                String s = String.valueOf(mapdata.get("field_i2fQn__c"));
                entity.setFieldI2FqnC(s);
            } else {
                entity.setFieldI2FqnC(null);
            }
            //entity.setFieldZagjlC((Timestamp) mapdata.get("field_ZAgjl__c"));
            Object field_ZAgjl__c = mapdata.get("field_ZAgjl__c");
            if (field_ZAgjl__c != null) {
                Timestamp time = new Timestamp(new Double((double) field_ZAgjl__c).longValue());
                entity.setFieldZagjlC(time);
            } else {
                entity.setFieldZagjlC(null);
            }
            //entity.setFieldYmp9NC((Timestamp) mapdata.get("field_Ymp9N__c"));
            Object field_Ymp9N__c = mapdata.get("field_Ymp9N__c");
            if (field_Ymp9N__c != null) {
                Timestamp time = new Timestamp(new Double((double) field_Ymp9N__c).longValue());
                entity.setFieldYmp9NC(time);
            } else {
                entity.setFieldYmp9NC(null);
            }
            entity.setFieldA1Fs2C((String) mapdata.get("field_a1fs2__c"));
            entity.setLockStatus((String) mapdata.get("lock_status"));
            entity.setOutOwner((String) mapdata.get("out_owner"));
            // entity.setFieldWypx1C((String) mapdata.get("field_WYpx1__c"));
            Object field_WYpx1__c = mapdata.get("field_WYpx1__c");
            if (field_WYpx1__c != null) {
                String s = String.valueOf(mapdata.get("field_WYpx1__c"));
                entity.setFieldWypx1C(s);
            } else {
                entity.setFieldWypx1C(null);
            }
            entity.setFieldRm16PC((String) mapdata.get("field_rM16p__c"));
            //entity.setFieldGfwgeC((String) mapdata.get("field_gFwgE__c"));
            Object field_gFwgE__c = mapdata.get("field_gFwgE__c");
            if (field_gFwgE__c != null) {
                String s = String.valueOf(mapdata.get("field_gFwgE__c"));
                entity.setFieldGfwgeC(s);
            } else {
                entity.setFieldGfwgeC(null);
            }
            entity.setFieldA7TmnC((String) mapdata.get("field_A7tmn__c"));
            entity.setFieldLxc8WC((String) mapdata.get("field_lxc8w__c"));
            entity.setFieldNnko3C((String) mapdata.get("field_nNkO3__c"));
            entity.setField1AcitC((String) mapdata.get("field_1acIT__c"));
            //entity.setFieldD25RiC((String) mapdata.get("field_d25RI__c"));
            Object field_d25RI__c = mapdata.get("field_d25RI__c");
            if (field_d25RI__c != null) {
                String s = String.valueOf(mapdata.get("field_d25RI__c"));
                entity.setFieldD25RiC(s);
            } else {
                entity.setFieldD25RiC(null);
            }
            entity.setField8OgirC((String) mapdata.get("field_8OgIR__c"));
            //entity.setField7Qor1C((Timestamp) mapdata.get("field_7qoR1__c"));
            Object field_7qoR1__c = mapdata.get("field_7qoR1__c");
            if (field_7qoR1__c != null) {
                Timestamp time = new Timestamp(new Double((double) field_7qoR1__c).longValue());
                entity.setField7Qor1C(time);
            } else {
                entity.setField7Qor1C(null);
            }
            //entity.setFieldJ19ElC((Timestamp) mapdata.get("field_j19El__c"));
            Object field_j19El__c = mapdata.get("field_j19El__c");
            if (field_j19El__c != null) {
                Timestamp time = new Timestamp(new Double((double) field_j19El__c).longValue());
                entity.setFieldJ19ElC(time);
            } else {
                entity.setFieldJ19ElC(null);
            }
            entity.setFieldG8U4UC((String) mapdata.get("field_g8u4u__c"));
            entity.setFieldWl12MC((String) mapdata.get("field_WL12m__c"));
            entity.setFieldGy25HC((String) mapdata.get("field_gY25H__c"));
            // entity.setFieldUn2B2C((Timestamp) mapdata.get("field_UN2b2__c"));
            Object field_UN2b2__c = mapdata.get("field_UN2b2__c");
            if (field_UN2b2__c != null) {
                Timestamp time = new Timestamp(new Double((double) field_UN2b2__c).longValue());
                entity.setFieldUn2B2C(time);
            } else {
                entity.setFieldUn2B2C(null);
            }
            //entity.setField21F79C((Timestamp) mapdata.get("field_21F79__c"));
            Object field_21F79__c = mapdata.get("field_21F79__c");
            if (field_21F79__c != null) {
                Timestamp time = new Timestamp(new Double((double) field_21F79__c).longValue());
                entity.setField21F79C(time);
            } else {
                entity.setField21F79C(null);
            }
            entity.setFieldJv2RcC((String) mapdata.get("field_jv2RC__c"));
            // entity.setFieldCy2D5C((String) mapdata.get("field_cy2d5__c"));
            Object field_cy2d5__c = mapdata.get("field_cy2d5__c");
            if (field_cy2d5__c != null) {
                String s = String.valueOf(mapdata.get("field_cy2d5__c"));
                entity.setFieldCy2D5C(s);
            } else {
                entity.setFieldCy2D5C(null);
            }
            entity.setFieldE90WcC((String) mapdata.get("field_e90WC__c"));
            entity.setField26UoaC((String) mapdata.get("field_26Uoa__c"));
            entity.setName((String) mapdata.get("name"));
            //entity.setField7Zb0VC((Timestamp) mapdata.get("field_7zb0v__c"));
            Object field_7zb0v__c = mapdata.get("field_7zb0v__c");
            if (field_7zb0v__c != null) {
                Timestamp time = new Timestamp(new Double((double) field_7zb0v__c).longValue());
                entity.setField7Zb0VC(time);
            } else {
                entity.setField7Zb0VC(null);
            }
            entity.setField637RsC((String) mapdata.get("field_637rs__c"));
            entity.setFieldOivpvC((String) mapdata.get("field_oivpV__c"));
            //entity.setField68FanC((Timestamp) mapdata.get("field_68faN__c"));
            Object field_68faN__c = mapdata.get("field_68faN__c");
            if (field_68faN__c != null) {
                Timestamp time = new Timestamp(new Double((double) field_68faN__c).longValue());
                entity.setField68FanC(time);
            } else {
                entity.setField68FanC(null);
            }
            //entity.setFieldA141CC((String) mapdata.get("field_A141c__c"));
            Object field_A141c__c = mapdata.get("field_A141c__c");
            if (field_A141c__c != null) {
                String s = String.valueOf(mapdata.get("field_A141c__c"));
                entity.setFieldA141CC(s);
            } else {
                entity.setFieldA141CC(null);
            }
            // entity.setFieldU4PjiC((String) mapdata.get("field_u4PJi__c"));
            Object field_u4PJi__c = mapdata.get("field_u4PJi__c");
            if (field_u4PJi__c != null) {
                String s = String.valueOf(mapdata.get("field_u4PJi__c"));
                entity.setFieldU4PjiC(s);
            } else {
                entity.setFieldU4PjiC(null);
            }
            entity.setField5Rn98C((String) mapdata.get("field_5Rn98__c"));
            entity.setFieldAgy12C((String) mapdata.get("field_aGY12__c"));
            //entity.setFieldG21OpC((String) mapdata.get("field_g21oP__c"));
            Object field_g21oP__c = mapdata.get("field_g21oP__c");
            if (field_g21oP__c != null) {
                String s = String.valueOf(mapdata.get("field_g21oP__c"));
                entity.setFieldG21OpC(s);
            } else {
                entity.setFieldG21OpC(null);
            }
            entity.setFieldK9Ha2C((String) mapdata.get("field_K9Ha2__c"));
            //entity.setFieldB2BjaC((Timestamp) mapdata.get("field_b2bJa__c"));
            Object field_b2bJa__c = mapdata.get("field_b2bJa__c");
            if (field_b2bJa__c != null) {
                Timestamp time = new Timestamp(new Double((double) field_b2bJa__c).longValue());
                entity.setFieldB2BjaC(time);
            } else {
                entity.setFieldB2BjaC(null);
            }
            //entity.setFieldW808EC((Timestamp) mapdata.get("field_w808e__c"));
            Object field_w808e__c = mapdata.get("field_w808e__c");
            if (field_w808e__c != null) {
                Timestamp time = new Timestamp(new Double((double) field_w808e__c).longValue());
                entity.setFieldW808EC(time);
            } else {
                entity.setFieldW808EC(null);
            }
            entity.setFieldYs17SC((String) mapdata.get("field_ys17S__c"));
            entity.setFieldXe9AvC((String) mapdata.get("field_xe9aV__c"));
            entity.setField16J6TC((String) mapdata.get("field_16j6t__c"));
            //entity.setFieldKxh3QC((Timestamp) mapdata.get("field_Kxh3Q__c"));
            Object field_Kxh3Q__c = mapdata.get("field_Kxh3Q__c");
            if (field_Kxh3Q__c != null) {
                Timestamp time = new Timestamp(new Double((double) field_Kxh3Q__c).longValue());
                entity.setFieldKxh3QC(time);
            } else {
                entity.setFieldKxh3QC(null);
            }
            //entity.setFieldDwcp5C((Timestamp) mapdata.get("field_DwcP5__c"));
            Object field_DwcP5__c = mapdata.get("field_DwcP5__c");
            if (field_DwcP5__c != null) {
                Timestamp time = new Timestamp(new Double((double) field_DwcP5__c).longValue());
                entity.setFieldDwcp5C(time);
            } else {
                entity.setFieldDwcp5C(null);
            }
            entity.setField3M152C((String) mapdata.get("field_3M152__c"));
            entity.setRecordType((String) mapdata.get("record_type"));
            entity.setFieldU6C1DC((String) mapdata.get("field_u6C1D__c"));
            entity.setFieldCkf22C((String) mapdata.get("field_Ckf22__c"));
            entity.setFieldS563IC((String) mapdata.get("field_s563i__c"));
            // entity.setFieldOse2EC((String) mapdata.get("field_osE2e__c"));
            Object field_osE2e__c = mapdata.get("field_osE2e__c");
            if (field_osE2e__c != null) {
                String s = String.valueOf(mapdata.get("field_osE2e__c"));
                entity.setFieldOse2EC(s);
            } else {
                entity.setFieldOse2EC(null);
            }
            //entity.setFieldJf1CmC((Timestamp) mapdata.get("field_jF1CM__c"));
            Object field_jF1CM__c = mapdata.get("field_jF1CM__c");
            if (field_jF1CM__c != null) {
                Timestamp time = new Timestamp(new Double((double) field_jF1CM__c).longValue());
                entity.setFieldJf1CmC(time);
            } else {
                entity.setFieldJf1CmC(null);
            }
            // entity.setFieldHewtuC((Timestamp) mapdata.get("field_hEwtu__c"));
            Object field_hEwtu__c = mapdata.get("field_hEwtu__c");
            if (field_hEwtu__c != null) {
                Timestamp time = new Timestamp(new Double((double) field_hEwtu__c).longValue());
                entity.setFieldHewtuC(time);
            } else {
                entity.setFieldHewtuC(null);
            }
            //entity.setLastModifiedBy((String) mapdata.get("last_modified_by"));
            Object last_modified_by = mapdata.get("last_modified_by");
            if (last_modified_by != null) {
                String s = String.valueOf(mapdata.get("last_modified_by"));
                entity.setLastModifiedBy(s);
            } else {
                entity.setLastModifiedBy(null);
            }
            // entity.setLastModifiedTime((String) mapdata.get("last_modified_time"));
            Object last_modified_time = mapdata.get("last_modified_time");
            if (last_modified_time != null) {
                Timestamp time = new Timestamp(new Double((double) last_modified_time).longValue());
                entity.setLastModifiedTime(time);
            } else {
                entity.setLastModifiedTime(null);
            }
            entity.setRecTimeStamp(time1);
            list.add(entity);
        }

        return list;
    }


    //TODO 产品小程序-案例页面访问统计
    public static List<IntfFinPageAccess> getPageAccess(int current) {
        //获取昨天时间的凌晨
        Calendar c1 = Calendar.getInstance();
        c1.set(Calendar.HOUR_OF_DAY, 23);
        c1.set(Calendar.MINUTE, 59);
        c1.set(Calendar.SECOND, 59);
       //c1.set(Calendar.MILLISECOND, 0);
        //获取昨天时间的最后一秒23:59:59
        Long longToday = c1.getTimeInMillis();
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String today = simpleDateFormat.format(new Date(longToday));

        //获取昨天时间的凌晨
        Calendar c = Calendar.getInstance();
        c.set(Calendar.HOUR_OF_DAY, 0);
        c.set(Calendar.MINUTE, 0);
        c.set(Calendar.SECOND, 0);
        c.set(Calendar.MILLISECOND, 0);
        long longYesterday = longToday - (24 * 60 * 60 * 1000);
        String yesterday = simpleDateFormat.format(new Date(longYesterday));

        //获取当前时间(实体类会赋值)
        Date date = new Date();
        DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String time1 = df.format(date);

        Map map11 = httpClientUtil.sendGet("http://naguan.vsites.cn/mlmw/api/case/SysLogSelect?size=500&starTime=" + yesterday + "&endTime=" + today+"&current="+current);
        //Map map11 = httpClientUtil.sendGet("http://naguan.vsites.cn/mlmw/api/case/SysLogSelect?size=500&current="+current);
        //获取最终数据
        Map<String, Object> data = (Map<String, Object>) map11.get("data");
        ArrayList<Object> records = (ArrayList<Object>) data.get("records");
        List<IntfFinPageAccess> list = new ArrayList<>();
        for (Object record : records) {
            Map<String, Object> mpdata = (Map<String, Object>) record;
            IntfFinPageAccess access = new IntfFinPageAccess();
            access.setOpenid((String) mpdata.get("openid"));
            access.setWechatName((String) mpdata.get("nickName"));
            //access.setVisitTime((String) mpdata.get("createTime"));
            Object createTime = mpdata.get("createTime");
            if (createTime != null) {
                String time = (String) createTime;
                Timestamp timestamp = new Timestamp(Timestamp.valueOf(time).getTime());
                access.setVisitTime(timestamp);
            } else {
                access.setVisitTime(null);
            }
            access.setCaseType((String) mpdata.get("type"));
            access.setCaseName((String) mpdata.get("spaceExampleName"));
            access.setRoomType((String) mpdata.get("name"));
            access.setRoomType(time1);
            list.add(access);
        }
        return list;

    }

    //TODO 应用级授权阶方法
    public  Map fenXiangInterface() {
        String param = "{\n" +
                "    \"appId\": \"" + appID + "\",\n" +
                "    \"appSecret\":\"" + appSecret + "\",\n" +
                "    \"permanentCode\":\"" + permanentCode + "\"\n" +
                "}";
        Map map = httpClientUtil.sendPostForJson("", param, urlTest);
      /*  System.out.println(map);
        System.out.println("openUserId=" + openUserId);*/
        return map;

    }


    //测试
    public static void main(String[] args) {
        Fenxiaofenke fenxiaofenke = new Fenxiaofenke();
        //Map map = fenxiaofenke.fenXiangInterface();
        //fenxiaofenke.getPageAccess();
        //List<IntfPrincipal> intfprincipalData = fenxiaofenke.getIntfprincipalData(0,10);
        //System.out.println(intfprincipalData);
        //  List<IntfContract> totalAndInfContract = fenxiaofenke.getTotalAndInfContract(0, 100);
        // List<TraceTable> traceTables = fenxiaofenke.customerTracking(0,500);
        //List<TraceTable> traceTables = fenxiaofenke.customerTracking(0,100);
        /*List<IntfPrincipal> intfprincipalData = fenxiaofenke.getIntfprincipalData(1000, 0);
        System.out.println(intfprincipalData.size());
        System.out.println(intfprincipalData.size());*/
        //List<IntfMarketingActivity> intfMarketingActivities = fenxiaofenke.getmarketingActivity(0, 500);
        //System.out.println(intfMarketingActivities.toString());
       /* List<IntfClient> clint = fenxiaofenke.getClint(0, 6000);
        System.out.println(clint);
        System.out.println(clint);*/
        // List<IntfWecat> getwecat = fenxiaofenke.getwecat(0, 500);
        //List<IntfCompanyOrder> companyOrder = fenxiaofenke.getCompanyOrder(500, 2500);
        // List<IntfServiceProject> serviceCompany = fenxiaofenke.getServiceCompany(0, 500);
        System.out.println("测试完毕");
    }

}